#if defined(TSINGMA_MX) || defined(TSINGMA_GX) || defined(ARCTIC)

#include "ctc_const.h"
#include "ctc_macro.h"
#include "ctc_error.h"
#include "ctc_diag.h"

#include "sys_usw_common.h"
#include "sys_tmm_discard_type.h"
#include "sys_usw_diag.h"

/*DROP_TO_DISCARD_START*/
int32
sys_tmm_map_drop_reason_ctc_to_sys(uint16 drop_reason, uint32* discard_type_bmp)
{
    switch(drop_reason)
    {
    case CTC_DROP_SCL_DENY:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_DS_USERID_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_DS_SCL_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_DS_VLAN_XLATE_DIS);
        break;
    case CTC_DROP_MPLS_CHK:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_MPLS_ENTROPY_LABEL_CHK);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_MPLS_TP_MCC_SCC_DIS);
        break;
    case CTC_DROP_TTL_CHK:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_OAM_BFD_TTL_CHK);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_TTL_FAIL);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_IP_MPLS_TTL_CHK_ERR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_PKT_HDR_C2C_TTL_ZERO);
        break;
    case CTC_DROP_NET_TX:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETTX_MIN_LEN);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETTX_NO_BUFFER);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETTX_SOP_EOP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETTX_SOP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETTX_TX_ERROR);
        break;
    case CTC_DROP_NONE:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_RESERVED0);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_DISCARD_PACKET_LOG_ALL_TYPE);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_RESERVED);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_RESERVED0);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_RESERVED5);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_RESERVED2);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_RESERVED4);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_RESERVED3);
        break;
    case CTC_DROP_NET_RX:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_NO_BUFFER);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_LEN_ERROR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_PKT_ERROR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_BPDU_ERROR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_FRAME_ERROR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_FROM_LOOP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_FROM_NETWORK);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_OUT_ERROR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_PFC_ERROR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_FROM_CPUMAC);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_FROM_DMA);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_FROM_OAM);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_TXQM3_MIDPRIO_DROP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_TXQM2_MIDPRIO_DROP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_TXQM1_MIDPRIO_DROP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_TXQM0_MIDPRIO_DROP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_TXQM3_HIGHPRIO_DROP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_TXQM2_HIGHPRIO_DROP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_TXQM1_HIGHPRIO_DROP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_TXQM0_HIGHPRIO_DROP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_CPUMAC_CHECK_ERROR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_MTULEN_CHECK);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_SOPBUF_FULL_DROP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_NETRX_VALIDBYTE_ERROR);
        break;
    case CTC_DROP_PORT_MAC_CHK:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_PORT_MAC_CHECK_DIS);
        break;
    case CTC_DROP_TRANSIT_DISABLE:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_DS_VLAN_TRANSMIT_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_DS_PORT_TRANSMIT_DIS);
        break;
    case CTC_DROP_ARP_MISS:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_ARP_MISS_DISCARD);
        break;
    case CTC_DROP_LATENCY:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_LATENCY_DISCARD);
        break;
    case CTC_DROP_STK_CHK:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_STACK_REFLECT_DISCARD);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_STACKING_HDR_CHK_ERR);
        break;
    case CTC_DROP_ARP_OR_DHCP_ERR:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_ARP_DHCP_DIS);
        break;
    case CTC_DROP_ACL_DENY:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_DS_ACL_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_DS_ACL_DIS);
        break;
    case CTC_DROP_TRAFFIC_MANAGER:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_BUFSTORE_ABORT_TOTAL);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_BUFSTORE_LEN_ERROR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_BUFSTORE_IRM_RESRC);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_BUFSTORE_DATA_ERR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_BUFSTORE_CHIP_MISMATCH);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_BUFSTORE_NO_BUFF);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_BUFSTORE_NO_EOP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_STALL_TO_BS_DROP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_BUFSTORE_SLIENT_TOTAL);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_TO_BUFSTORE_FROM_DMA);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_TO_BUFSTORE_FROM_NETRX);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_TO_BUFSTORE_FROM_OAM);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_BUFSTORE_OUT_SOP_PKT_LEN_ERR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_DMA);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_DMA);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_ELOOP_MCAST);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_ELOOP_UCAST);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_IPE_CUT_THR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_IPE_CUT_THR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_IPE);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_IPE);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_OAM);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_OAM);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_BUFRETRV_FROM_DEQ_MSG_ERR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_BUFRETRV_FROM_QMGR_LEN_ERR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_BUFRETRV_OUT_DROP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_WRED_DROP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_TOTAL_DROP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_NO_QUEUE_ENTRY);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_PORT_NO_BUFF);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_QUEUE_NO_BUFF);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_SC_NO_BUFF);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_SPAN_NO_BUFF);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_TOTAL_NO_BUFF);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_CFLEX_ISOLATE_BLOCK);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_CHAN_INVALID);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_TOTAL);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_LAG);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_LAG_ERR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_LAG_MC);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_LAG_NO_MEM);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_PORT_ISOLATE_BLOCK);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_RSV_CHAN_DROP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_STACKING_LAG);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_OAM_HW_ERROR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_OAM_EXCEPTION);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_CPU);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_BUFSTORE_HW_ERR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_CPU);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_ELOG);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_ELOG);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_IPE_CUT_THR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_IPE_CUT_THR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_IPE);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_IPE);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_ELOOP_MCAST);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_ELOOP_UCAST);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_BUFSTORE_DROP_DESTID);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_PORT_SC_NO_BUFF);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ENQ_NO_RESRC);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ERM_CHECK_FAIL);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ERM_CRIT_CHECK_FAIL);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ERM_TOTAL_CHECK_FAIL);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ERM_SC_CHECK_FAIL);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ERM_PORTSC_CHECK_FAIL);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ERM_PORT_CHECK_FAIL);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ERM_QUEUE_CHECK_FAIL);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ERM_AQMQUEUE_CHECK_FAIL);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ERM_C2C_CHECK_FAIL);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ERM_CHECK_FAIL);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_ERM_NO_FREEPTR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_QWRITE_CFLEX_ISOLATE_BLOCK);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_QWRITE_PORT_ISOLATE_BLOCK);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_QWRITE_CHAN);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_QWRITE_FABRIC_TO_ILOOP);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_QWRITE_DROP_FROM_MET);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_UCHI_COVER_LOG);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_UCLO_COVER_LOG);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_MCHI_COVER_LOG);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_MCLO_COVER_LOG);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_UCHI_IS_LOG);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_UCLO_IS_LOG);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_MCHI_IS_LOG);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_METFIFO_MCLO_IS_LOG);
        break;
    case CTC_DROP_APS:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_APS_DIS);
        break;
    case CTC_DROP_PKT_ERR:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_L2_ILLEGAL_PKT_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_ICMP_ERR_MSG_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_MPLS_MC_PKT_ERROR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_HDR_ADJ_DESTID_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_HDR_ADJ_REMOVE_ERR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_CRC_ERR_DIS);
        break;
    case CTC_DROP_SD_CHK:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_SD_CHECK_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_SD_CHK_DISCARD);
        break;
    case CTC_DROP_EXCP:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_EXCEP2_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_FATAL_EXCEP_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_L3_EXCEP_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_L2_EXCPTION_DIS);
        break;
    case CTC_DROP_ICMP_ERR:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_ICMP_REDIRECT_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_NAT_PT_ICMP_ERR);
        break;
    case CTC_DROP_ISOLATE_CHK:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_CFLAX_SRC_ISOLATE_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_PORT_ISO_DIS);
        break;
    case CTC_DROP_TUNNEL_CHK:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_TUNNEL_ECN_DIS);
        break;
    case CTC_DROP_PON:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_PON_DOWNSTREAM_CHECK_FAIL);
        break;
    case CTC_DROP_IP_SRC_GUARD:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_USERID_BINDING_DIS);
        break;
    case CTC_DROP_POLICING:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_SVC_POLICING_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_DS_PLC_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_DS_PLC_DIS);
        break;
    case CTC_DROP_BFD:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_BFD_DIS);
        break;
    case CTC_DROP_VPLS:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_VPLS_HORIZON_SPLIT_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_EVPN_HORIZON_SPLIT_DIS);
        break;
    case CTC_DROP_TRILL:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_TRILL_CHK);
        break;
    case CTC_DROP_PTP:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_PTP_PKT_DIS);
        break;
    case CTC_DROP_BPE_PORT_ERR:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_MUX_PORT_ERR);
        break;
    case CTC_DROP_EDIT_ERR:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_DS_L3EDIT_DATA_VIOLATE1);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_DS_L3EDIT_DATA_VIOLATE2);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_DS_L3EDITNAT_DATA_VIOLATE);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_DS_L2EDIT_DATA_VIOLATE1);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_DS_L2EDIT_DATA_VIOLATE2);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_INT_SINK_DIS);
        break;
    case CTC_DROP_IP_CHK:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_ROUTE_ERROR_PKT_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_TUNNEL_DECAP_MARTIAN_ADD);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_SAME_IPDA_IPSA_DIS);
        break;
    case CTC_DROP_RECEIVE_DISABLE:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_RECEIVE_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_DS_PHYPORT_SRCDIS);
        break;
    case CTC_DROP_FWD_ERR:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_DEST_MAP_PROFILE_DISCARD);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_NO_FORWARDING_PTR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_IS_DIS_FORWARDING_PTR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_DS_FWD_DESTID_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_TUNNELID_FWD_PTR_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_INT_CHK);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_USERID_CHK);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_DS_DESTPHYPORT_DSTID_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_BRG_TO_SAME_PORT_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_UC_MC_FLOODING_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_LOGIC_PORT_CHK_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_PORT_REFLECTIVE_CHK_DIS);
        break;
    case CTC_DROP_VLAN_FILTER:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_PROTOCOL_VLAN_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_AFT_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_VLAN_FILTER_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_VLAN_FILTER_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_DEST_VLAN_PTR_DIS);
        break;
    case CTC_DROP_LPBK_ERR:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_LPBK_HDR_ADJ_RM_ERR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_LOOPBACK_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_ILLEGAL_PACKET_TO_E2I_LOOP_CHANNEL);
        break;
    case CTC_DROP_MTU_CHK:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_TUNNEL_MTU_CHK_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_INTERF_MTU_CHK_DIS);
        break;
    case CTC_DROP_HW_ERR:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_HW_ERROR_DISCARD);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_HARD_ERROR_DIS);
        break;
    case CTC_DROP_STP_CHK:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_STP_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_STP_DIS);
        break;
    case CTC_DROP_MIMICRY:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_MIMICRY_DIS);
        break;
    case CTC_DROP_QUEUE:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_SPAN_ONDROP_RSV_QUID);
        break;
    case CTC_DROP_CHKSUM_ERR:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_PT_UDP_CHKSUM_ZERO);
        break;
    case CTC_DROP_SECURITY_CHK:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_SECURITY_CHK_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_STORM_CTL_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_LEARNING_DIS);
        break;
    case CTC_DROP_DOT1AE:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_MACSEC_UNCONTROLLED_PORT_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_UNKNOWN_DOT11_PACKET_DISCARD);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_DOT1AE_PN_OVERFLOW);
        break;
    case CTC_DROP_LAG_EMPTY:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_UC_TO_LAG_GROUP_NO_MEMBER);
        break;
    case CTC_DROP_OAM:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_OAM_DISABLE);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_OAM_NOT_FOUND);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_OAM_ETH_VLAN_CHK);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_OAM_FILTER_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_EFM_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_OAM_802_3_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_OAM_EDGE_PORT_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_LOCAL_OAM_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_OAM_FILTERING_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_OAM_TO_LOCAL_DIS);
        break;
    case CTC_DROP_PARSER_ERR:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_PARSER_LEN_ERR);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_PARSER_LEN_ERR);
        break;
    case CTC_DROP_VXLAN_CHK:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_VXLAN_FLAG_CHK_ERROR_DISCARD);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_VXLAN_NVGRE_INNER_VTAG_CHK_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_VXLAN_NVGRE_CHK_FAIL);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_IPE_GENEVE_PAKCET_DISCARD);
        break;
    case CTC_DROP_MIRROR:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_REMOTE_MIRROR_ESCAP_DIS);
        break;
    case CTC_DROP_PLD_OP_ERR:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_ROUTE_PLD_OP_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_BRIDGE_PLD_OP_DIS);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_STRIP_OFFSET_LARGE);
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_EPE_TRILL_PLD_OP_DIS);
        break;
    case CTC_DROP_BS:
        CTC_BMP_SET(discard_type_bmp, SYS_TMM_DISCARD_BSR_BUFSTORE_FIFO_FULL);
        break;
    case CTC_DROP_OTHER:
        CTC_BMP_SET(discard_type_bmp,SYS_TMM_DISCARD_BSR_EPE_HW_L2_EDIT);
        CTC_BMP_SET(discard_type_bmp,SYS_TMM_DISCARD_BSR_EPE_HW_L3_EDIT);
        CTC_BMP_SET(discard_type_bmp,SYS_TMM_DISCARD_BSR_EPE_HW_INNER_L2);
        CTC_BMP_SET(discard_type_bmp,SYS_TMM_DISCARD_BSR_EPE_HW_PAYLOAD);
        CTC_BMP_SET(discard_type_bmp,SYS_TMM_DISCARD_BSR_EPE_PAYLOAD);
        CTC_BMP_SET(discard_type_bmp,SYS_TMM_DISCARD_BSR_EPE_L2_EDIT);
        CTC_BMP_SET(discard_type_bmp,SYS_TMM_DISCARD_BSR_EPE_L3_EDIT);
        CTC_BMP_SET(discard_type_bmp,SYS_TMM_DISCARD_BSR_EPE_INNER_L2);
        CTC_BMP_SET(discard_type_bmp,SYS_TMM_DISCARD_BSR_EPE_MIN_PKT_LEN_ERR);
        CTC_BMP_SET(discard_type_bmp,SYS_TMM_DISCARD_BSR_EPE_ELOG_ABORTED_PKT);
        CTC_BMP_SET(discard_type_bmp,SYS_TMM_DISCARD_BSR_EPE_TRUNCATE_PKT);
        CTC_BMP_SET(discard_type_bmp,SYS_TMM_DISCARD_BSR_EPE_DATA_ERR);
        break;
    default:
        break;
    }
    return 0;
}
/*DROP_TO_DISCARD_END*/

/*DISCARD_TO_DROP_START*/
int32
sys_tmm_map_drop_reason_sys_to_ctc(uint16 discard_type, uint16* p_drop_reason)
{
    uint16 drop_reason = CTC_DROP_NONE;
    switch(discard_type)
    {
    case SYS_TMM_DISCARD_IPE_DS_USERID_DIS:
    case SYS_TMM_DISCARD_IPE_DS_SCL_DIS:
        drop_reason = CTC_DROP_SCL_DENY;
        break;
    case SYS_TMM_DISCARD_IPE_MPLS_ENTROPY_LABEL_CHK:
    case SYS_TMM_DISCARD_IPE_MPLS_TP_MCC_SCC_DIS:
        drop_reason = CTC_DROP_MPLS_CHK;
        break;
    case SYS_TMM_DISCARD_IPE_OAM_BFD_TTL_CHK:
        drop_reason = CTC_DROP_TTL_CHK;
        break;
    case SYS_TMM_DISCARD_IPE_RESERVED0:
    case SYS_TMM_DISCARD_IPE_DISCARD_PACKET_LOG_ALL_TYPE:
        drop_reason = CTC_DROP_NONE;
        break;
    case SYS_TMM_DISCARD_IPE_PORT_MAC_CHECK_DIS:
        drop_reason = CTC_DROP_PORT_MAC_CHK;
        break;
    case SYS_TMM_DISCARD_IPE_STACK_REFLECT_DISCARD:
    case SYS_TMM_DISCARD_IPE_STACKING_HDR_CHK_ERR:
        drop_reason = CTC_DROP_STK_CHK;
        break;
    case SYS_TMM_DISCARD_IPE_ARP_DHCP_DIS:
        drop_reason = CTC_DROP_ARP_OR_DHCP_ERR;
        break;
    case SYS_TMM_DISCARD_IPE_DS_ACL_DIS:
        drop_reason = CTC_DROP_ACL_DENY;
        break;
    case SYS_TMM_DISCARD_IPE_APS_DIS:
        drop_reason = CTC_DROP_APS;
        break;
    case SYS_TMM_DISCARD_IPE_L2_ILLEGAL_PKT_DIS:
    case SYS_TMM_DISCARD_IPE_ICMP_ERR_MSG_DIS:
    case SYS_TMM_DISCARD_IPE_MPLS_MC_PKT_ERROR:
        drop_reason = CTC_DROP_PKT_ERR;
        break;
    case SYS_TMM_DISCARD_IPE_SD_CHECK_DIS:
        drop_reason = CTC_DROP_SD_CHK;
        break;
    case SYS_TMM_DISCARD_IPE_EXCEP2_DIS:
    case SYS_TMM_DISCARD_IPE_FATAL_EXCEP_DIS:
    case SYS_TMM_DISCARD_IPE_L3_EXCEP_DIS:
    case SYS_TMM_DISCARD_IPE_L2_EXCPTION_DIS:
        drop_reason = CTC_DROP_EXCP;
        break;
    case SYS_TMM_DISCARD_IPE_ICMP_REDIRECT_DIS:
        drop_reason = CTC_DROP_ICMP_ERR;
        break;
    case SYS_TMM_DISCARD_IPE_CFLAX_SRC_ISOLATE_DIS:
        drop_reason = CTC_DROP_ISOLATE_CHK;
        break;
    case SYS_TMM_DISCARD_IPE_TUNNEL_ECN_DIS:
        drop_reason = CTC_DROP_TUNNEL_CHK;
        break;
    case SYS_TMM_DISCARD_IPE_USERID_BINDING_DIS:
        drop_reason = CTC_DROP_IP_SRC_GUARD;
        break;
    case SYS_TMM_DISCARD_IPE_SVC_POLICING_DIS:
    case SYS_TMM_DISCARD_IPE_DS_PLC_DIS:
        drop_reason = CTC_DROP_POLICING;
        break;
    case SYS_TMM_DISCARD_IPE_TRILL_CHK:
        drop_reason = CTC_DROP_TRILL;
        break;
    case SYS_TMM_DISCARD_IPE_PTP_PKT_DIS:
        drop_reason = CTC_DROP_PTP;
        break;
    case SYS_TMM_DISCARD_IPE_MUX_PORT_ERR:
        drop_reason = CTC_DROP_BPE_PORT_ERR;
        break;
    case SYS_TMM_DISCARD_IPE_ROUTE_ERROR_PKT_DIS:
    case SYS_TMM_DISCARD_IPE_TUNNEL_DECAP_MARTIAN_ADD:
        drop_reason = CTC_DROP_IP_CHK;
        break;
    case SYS_TMM_DISCARD_IPE_RECEIVE_DIS:
    case SYS_TMM_DISCARD_IPE_DS_PHYPORT_SRCDIS:
        drop_reason = CTC_DROP_RECEIVE_DISABLE;
        break;
    case SYS_TMM_DISCARD_IPE_DEST_MAP_PROFILE_DISCARD:
    case SYS_TMM_DISCARD_IPE_NO_FORWARDING_PTR:
    case SYS_TMM_DISCARD_IPE_IS_DIS_FORWARDING_PTR:
    case SYS_TMM_DISCARD_IPE_DS_FWD_DESTID_DIS:
    case SYS_TMM_DISCARD_IPE_TUNNELID_FWD_PTR_DIS:
    case SYS_TMM_DISCARD_IPE_INT_CHK:
    case SYS_TMM_DISCARD_IPE_USERID_CHK:
        drop_reason = CTC_DROP_FWD_ERR;
        break;
    case SYS_TMM_DISCARD_IPE_PROTOCOL_VLAN_DIS:
    case SYS_TMM_DISCARD_IPE_AFT_DIS:
    case SYS_TMM_DISCARD_IPE_VLAN_FILTER_DIS:
        drop_reason = CTC_DROP_VLAN_FILTER;
        break;
    case SYS_TMM_DISCARD_IPE_LPBK_HDR_ADJ_RM_ERR:
    case SYS_TMM_DISCARD_IPE_LOOPBACK_DIS:
        drop_reason = CTC_DROP_LPBK_ERR;
        break;
    case SYS_TMM_DISCARD_IPE_HW_ERROR_DISCARD:
        drop_reason = CTC_DROP_HW_ERR;
        break;
    case SYS_TMM_DISCARD_IPE_STP_DIS:
        drop_reason = CTC_DROP_STP_CHK;
        break;
    case SYS_TMM_DISCARD_IPE_MIMICRY_DIS:
        drop_reason = CTC_DROP_MIMICRY;
        break;
    case SYS_TMM_DISCARD_IPE_SECURITY_CHK_DIS:
    case SYS_TMM_DISCARD_IPE_STORM_CTL_DIS:
    case SYS_TMM_DISCARD_IPE_LEARNING_DIS:
        drop_reason = CTC_DROP_SECURITY_CHK;
        break;
    case SYS_TMM_DISCARD_IPE_MACSEC_UNCONTROLLED_PORT_DIS:
        drop_reason = CTC_DROP_DOT1AE;
        break;
    case SYS_TMM_DISCARD_IPE_UC_TO_LAG_GROUP_NO_MEMBER:
        drop_reason = CTC_DROP_LAG_EMPTY;
        break;
    case SYS_TMM_DISCARD_IPE_OAM_DISABLE:
    case SYS_TMM_DISCARD_IPE_OAM_NOT_FOUND:
    case SYS_TMM_DISCARD_IPE_OAM_ETH_VLAN_CHK:
    case SYS_TMM_DISCARD_IPE_OAM_FILTER_DIS:
    case SYS_TMM_DISCARD_IPE_EFM_DIS:
        drop_reason = CTC_DROP_OAM;
        break;
    case SYS_TMM_DISCARD_IPE_PARSER_LEN_ERR:
        drop_reason = CTC_DROP_PARSER_ERR;
        break;
    case SYS_TMM_DISCARD_IPE_VXLAN_FLAG_CHK_ERROR_DISCARD:
    case SYS_TMM_DISCARD_IPE_VXLAN_NVGRE_INNER_VTAG_CHK_DIS:
    case SYS_TMM_DISCARD_IPE_VXLAN_NVGRE_CHK_FAIL:
    case SYS_TMM_DISCARD_IPE_GENEVE_PAKCET_DISCARD:
        drop_reason = CTC_DROP_VXLAN_CHK;
        break;
    case SYS_TMM_DISCARD_EPE_TTL_FAIL:
    case SYS_TMM_DISCARD_EPE_IP_MPLS_TTL_CHK_ERR:
    case SYS_TMM_DISCARD_EPE_PKT_HDR_C2C_TTL_ZERO:
        drop_reason = CTC_DROP_TTL_CHK;
        break;
    case SYS_TMM_DISCARD_EPE_RESERVED:
    case SYS_TMM_DISCARD_EPE_RESERVED0:
    case SYS_TMM_DISCARD_EPE_RESERVED5:
    case SYS_TMM_DISCARD_EPE_RESERVED2:
    case SYS_TMM_DISCARD_EPE_RESERVED4:
    case SYS_TMM_DISCARD_EPE_RESERVED3:
        drop_reason = CTC_DROP_NONE;
        break;
    case SYS_TMM_DISCARD_EPE_ARP_MISS_DISCARD:
        drop_reason = CTC_DROP_ARP_MISS;
        break;
    case SYS_TMM_DISCARD_EPE_LATENCY_DISCARD:
        drop_reason = CTC_DROP_LATENCY;
        break;
    case SYS_TMM_DISCARD_EPE_TUNNEL_MTU_CHK_DIS:
    case SYS_TMM_DISCARD_EPE_INTERF_MTU_CHK_DIS:
        drop_reason = CTC_DROP_MTU_CHK;
        break;
    case SYS_TMM_DISCARD_EPE_REMOTE_MIRROR_ESCAP_DIS:
        drop_reason = CTC_DROP_MIRROR;
        break;
    case SYS_TMM_DISCARD_EPE_HDR_ADJ_DESTID_DIS:
    case SYS_TMM_DISCARD_EPE_HDR_ADJ_REMOVE_ERR:
    case SYS_TMM_DISCARD_EPE_CRC_ERR_DIS:
        drop_reason = CTC_DROP_PKT_ERR;
        break;
    case SYS_TMM_DISCARD_EPE_SD_CHK_DISCARD:
        drop_reason = CTC_DROP_SD_CHK;
        break;
    case SYS_TMM_DISCARD_EPE_NAT_PT_ICMP_ERR:
        drop_reason = CTC_DROP_ICMP_ERR;
        break;
    case SYS_TMM_DISCARD_EPE_PORT_ISO_DIS:
        drop_reason = CTC_DROP_ISOLATE_CHK;
        break;
    case SYS_TMM_DISCARD_EPE_PON_DOWNSTREAM_CHECK_FAIL:
        drop_reason = CTC_DROP_PON;
        break;
    case SYS_TMM_DISCARD_EPE_BFD_DIS:
        drop_reason = CTC_DROP_BFD;
        break;
    case SYS_TMM_DISCARD_EPE_VPLS_HORIZON_SPLIT_DIS:
    case SYS_TMM_DISCARD_EPE_EVPN_HORIZON_SPLIT_DIS:
        drop_reason = CTC_DROP_VPLS;
        break;
    case SYS_TMM_DISCARD_EPE_DS_VLAN_TRANSMIT_DIS:
    case SYS_TMM_DISCARD_EPE_DS_PORT_TRANSMIT_DIS:
        drop_reason = CTC_DROP_TRANSIT_DISABLE;
        break;
    case SYS_TMM_DISCARD_EPE_HARD_ERROR_DIS:
        drop_reason = CTC_DROP_HW_ERR;
        break;
    case SYS_TMM_DISCARD_EPE_DS_L3EDIT_DATA_VIOLATE1:
    case SYS_TMM_DISCARD_EPE_DS_L3EDIT_DATA_VIOLATE2:
    case SYS_TMM_DISCARD_EPE_DS_L3EDITNAT_DATA_VIOLATE:
    case SYS_TMM_DISCARD_EPE_DS_L2EDIT_DATA_VIOLATE1:
    case SYS_TMM_DISCARD_EPE_DS_L2EDIT_DATA_VIOLATE2:
    case SYS_TMM_DISCARD_EPE_INT_SINK_DIS:
        drop_reason = CTC_DROP_EDIT_ERR;
        break;
    case SYS_TMM_DISCARD_EPE_SAME_IPDA_IPSA_DIS:
        drop_reason = CTC_DROP_IP_CHK;
        break;
    case SYS_TMM_DISCARD_EPE_DS_DESTPHYPORT_DSTID_DIS:
    case SYS_TMM_DISCARD_EPE_BRG_TO_SAME_PORT_DIS:
    case SYS_TMM_DISCARD_EPE_UC_MC_FLOODING_DIS:
    case SYS_TMM_DISCARD_EPE_LOGIC_PORT_CHK_DIS:
    case SYS_TMM_DISCARD_EPE_PORT_REFLECTIVE_CHK_DIS:
        drop_reason = CTC_DROP_FWD_ERR;
        break;
    case SYS_TMM_DISCARD_EPE_VLAN_FILTER_DIS:
    case SYS_TMM_DISCARD_EPE_DEST_VLAN_PTR_DIS:
        drop_reason = CTC_DROP_VLAN_FILTER;
        break;
    case SYS_TMM_DISCARD_EPE_ILLEGAL_PACKET_TO_E2I_LOOP_CHANNEL:
        drop_reason = CTC_DROP_LPBK_ERR;
        break;
    case SYS_TMM_DISCARD_EPE_OAM_802_3_DIS:
    case SYS_TMM_DISCARD_EPE_OAM_EDGE_PORT_DIS:
    case SYS_TMM_DISCARD_EPE_LOCAL_OAM_DIS:
    case SYS_TMM_DISCARD_EPE_OAM_FILTERING_DIS:
    case SYS_TMM_DISCARD_EPE_OAM_TO_LOCAL_DIS:
        drop_reason = CTC_DROP_OAM;
        break;
    case SYS_TMM_DISCARD_EPE_DS_PLC_DIS:
        drop_reason = CTC_DROP_POLICING;
        break;
    case SYS_TMM_DISCARD_EPE_STP_DIS:
        drop_reason = CTC_DROP_STP_CHK;
        break;
    case SYS_TMM_DISCARD_EPE_SPAN_ONDROP_RSV_QUID:
        drop_reason = CTC_DROP_QUEUE;
        break;
    case SYS_TMM_DISCARD_EPE_PT_UDP_CHKSUM_ZERO:
        drop_reason = CTC_DROP_CHKSUM_ERR;
        break;
    case SYS_TMM_DISCARD_EPE_DS_VLAN_XLATE_DIS:
        drop_reason = CTC_DROP_SCL_DENY;
        break;
    case SYS_TMM_DISCARD_EPE_UNKNOWN_DOT11_PACKET_DISCARD:
    case SYS_TMM_DISCARD_EPE_DOT1AE_PN_OVERFLOW:
        drop_reason = CTC_DROP_DOT1AE;
        break;
    case SYS_TMM_DISCARD_EPE_PARSER_LEN_ERR:
        drop_reason = CTC_DROP_PARSER_ERR;
        break;
    case SYS_TMM_DISCARD_EPE_DS_ACL_DIS:
        drop_reason = CTC_DROP_ACL_DENY;
        break;
    case SYS_TMM_DISCARD_EPE_ROUTE_PLD_OP_DIS:
    case SYS_TMM_DISCARD_EPE_BRIDGE_PLD_OP_DIS:
    case SYS_TMM_DISCARD_EPE_STRIP_OFFSET_LARGE:
    case SYS_TMM_DISCARD_EPE_TRILL_PLD_OP_DIS:
        drop_reason = CTC_DROP_PLD_OP_ERR;
        break;
    case SYS_TMM_DISCARD_BSR_BUFSTORE_ABORT_TOTAL:
    case SYS_TMM_DISCARD_BSR_BUFSTORE_LEN_ERROR:
    case SYS_TMM_DISCARD_BSR_BUFSTORE_IRM_RESRC:
    case SYS_TMM_DISCARD_BSR_BUFSTORE_DATA_ERR:
    case SYS_TMM_DISCARD_BSR_BUFSTORE_CHIP_MISMATCH:
    case SYS_TMM_DISCARD_BSR_BUFSTORE_NO_BUFF:
    case SYS_TMM_DISCARD_BSR_BUFSTORE_NO_EOP:
    case SYS_TMM_DISCARD_BSR_METFIFO_STALL_TO_BS_DROP:
    case SYS_TMM_DISCARD_BSR_BUFSTORE_SLIENT_TOTAL:
    case SYS_TMM_DISCARD_BSR_TO_BUFSTORE_FROM_DMA:
    case SYS_TMM_DISCARD_BSR_TO_BUFSTORE_FROM_NETRX:
    case SYS_TMM_DISCARD_BSR_TO_BUFSTORE_FROM_OAM:
    case SYS_TMM_DISCARD_BSR_BUFSTORE_OUT_SOP_PKT_LEN_ERR:
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_DMA:
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_DMA:
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_ELOOP_MCAST:
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_ELOOP_UCAST:
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_IPE_CUT_THR:
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_IPE_CUT_THR:
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_IPE:
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_IPE:
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_OAM:
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_OAM:
    case SYS_TMM_DISCARD_BSR_BUFRETRV_FROM_DEQ_MSG_ERR:
    case SYS_TMM_DISCARD_BSR_BUFRETRV_FROM_QMGR_LEN_ERR:
    case SYS_TMM_DISCARD_BSR_BUFRETRV_OUT_DROP:
    case SYS_TMM_DISCARD_BSR_ENQ_WRED_DROP:
    case SYS_TMM_DISCARD_BSR_ENQ_TOTAL_DROP:
    case SYS_TMM_DISCARD_BSR_ENQ_NO_QUEUE_ENTRY:
    case SYS_TMM_DISCARD_BSR_ENQ_PORT_NO_BUFF:
    case SYS_TMM_DISCARD_BSR_ENQ_QUEUE_NO_BUFF:
    case SYS_TMM_DISCARD_BSR_ENQ_SC_NO_BUFF:
    case SYS_TMM_DISCARD_BSR_ENQ_SPAN_NO_BUFF:
    case SYS_TMM_DISCARD_BSR_ENQ_TOTAL_NO_BUFF:
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP:
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_CFLEX_ISOLATE_BLOCK:
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_CHAN_INVALID:
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_TOTAL:
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_LAG:
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_LAG_ERR:
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_LAG_MC:
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_LAG_NO_MEM:
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_PORT_ISOLATE_BLOCK:
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_RSV_CHAN_DROP:
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_STACKING_LAG:
    case SYS_TMM_DISCARD_BSR_OAM_HW_ERROR:
    case SYS_TMM_DISCARD_BSR_OAM_EXCEPTION:
    case SYS_TMM_DISCARD_BSR_BUFSTORE_HW_ERR:
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_CPU:
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_CPU:
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_ELOG:
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_ELOG:
    case SYS_TMM_DISCARD_BSR_BUFSTORE_DROP_DESTID:
    case SYS_TMM_DISCARD_BSR_ENQ_PORT_SC_NO_BUFF:
    case SYS_TMM_DISCARD_BSR_ENQ_NO_RESRC:
    case SYS_TMM_DISCARD_BSR_ERM_CHECK_FAIL:
    case SYS_TMM_DISCARD_BSR_ERM_CRIT_CHECK_FAIL:
    case SYS_TMM_DISCARD_BSR_ERM_TOTAL_CHECK_FAIL:
    case SYS_TMM_DISCARD_BSR_ERM_SC_CHECK_FAIL:
    case SYS_TMM_DISCARD_BSR_ERM_PORTSC_CHECK_FAIL:
    case SYS_TMM_DISCARD_BSR_ERM_PORT_CHECK_FAIL:
    case SYS_TMM_DISCARD_BSR_ERM_QUEUE_CHECK_FAIL:
    case SYS_TMM_DISCARD_BSR_ERM_AQMQUEUE_CHECK_FAIL:
    case SYS_TMM_DISCARD_BSR_ERM_C2C_CHECK_FAIL:
    case SYS_TMM_DISCARD_BSR_ERM_NO_FREEPTR:
    case SYS_TMM_DISCARD_BSR_QWRITE_CFLEX_ISOLATE_BLOCK:
    case SYS_TMM_DISCARD_BSR_METFIFO_UCHI_COVER_LOG:
    case SYS_TMM_DISCARD_BSR_METFIFO_UCLO_COVER_LOG:
    case SYS_TMM_DISCARD_BSR_METFIFO_MCHI_COVER_LOG:
    case SYS_TMM_DISCARD_BSR_METFIFO_MCLO_COVER_LOG:
    case SYS_TMM_DISCARD_BSR_METFIFO_UCHI_IS_LOG:
    case SYS_TMM_DISCARD_BSR_METFIFO_UCLO_IS_LOG:
    case SYS_TMM_DISCARD_BSR_METFIFO_MCHI_IS_LOG:
    case SYS_TMM_DISCARD_BSR_METFIFO_MCLO_IS_LOG:
        drop_reason = CTC_DROP_TRAFFIC_MANAGER;
        break;
    case SYS_TMM_DISCARD_BSR_BUFSTORE_FIFO_FULL:
        drop_reason = CTC_DROP_BS;
        break;
    case SYS_TMM_DISCARD_NETRX_NO_BUFFER:
    case SYS_TMM_DISCARD_NETRX_LEN_ERROR:
    case SYS_TMM_DISCARD_NETRX_PKT_ERROR:
    case SYS_TMM_DISCARD_NETRX_BPDU_ERROR:
    case SYS_TMM_DISCARD_NETRX_FRAME_ERROR:
    case SYS_TMM_DISCARD_NETRX_FROM_CPUMAC:
    case SYS_TMM_DISCARD_NETRX_FROM_DMA:
    case SYS_TMM_DISCARD_NETRX_FROM_OAM:
    case SYS_TMM_DISCARD_NETRX_FROM_LOOP:
    case SYS_TMM_DISCARD_NETRX_FROM_NETWORK:
    case SYS_TMM_DISCARD_NETRX_OUT_ERROR:
    case SYS_TMM_DISCARD_NETRX_PFC_ERROR:
    case SYS_TMM_DISCARD_NETRX_TXQM3_MIDPRIO_DROP:
    case SYS_TMM_DISCARD_NETRX_TXQM2_MIDPRIO_DROP:
    case SYS_TMM_DISCARD_NETRX_TXQM1_MIDPRIO_DROP:
    case SYS_TMM_DISCARD_NETRX_TXQM0_MIDPRIO_DROP:
    case SYS_TMM_DISCARD_NETRX_TXQM3_HIGHPRIO_DROP:
    case SYS_TMM_DISCARD_NETRX_TXQM2_HIGHPRIO_DROP:
    case SYS_TMM_DISCARD_NETRX_TXQM1_HIGHPRIO_DROP:
    case SYS_TMM_DISCARD_NETRX_TXQM0_HIGHPRIO_DROP:
    case SYS_TMM_DISCARD_NETRX_CPUMAC_CHECK_ERROR:
    case SYS_TMM_DISCARD_NETRX_MTULEN_CHECK:
    case SYS_TMM_DISCARD_NETRX_SOPBUF_FULL_DROP:
    case SYS_TMM_DISCARD_NETRX_VALIDBYTE_ERROR:
        drop_reason = CTC_DROP_NET_RX;
        break;
    case SYS_TMM_DISCARD_NETTX_MIN_LEN:
    case SYS_TMM_DISCARD_NETTX_NO_BUFFER:
    case SYS_TMM_DISCARD_NETTX_SOP_EOP:
    case SYS_TMM_DISCARD_NETTX_SOP:
    case SYS_TMM_DISCARD_NETTX_TX_ERROR:
        drop_reason = CTC_DROP_NET_TX;
        break;
    case SYS_TMM_DISCARD_BSR_EPE_HW_L2_EDIT:
    case SYS_TMM_DISCARD_BSR_EPE_HW_L3_EDIT:
    case SYS_TMM_DISCARD_BSR_EPE_HW_INNER_L2:
    case SYS_TMM_DISCARD_BSR_EPE_HW_PAYLOAD:
    case SYS_TMM_DISCARD_BSR_EPE_PAYLOAD:
    case SYS_TMM_DISCARD_BSR_EPE_L2_EDIT:
    case SYS_TMM_DISCARD_BSR_EPE_L3_EDIT:
    case SYS_TMM_DISCARD_BSR_EPE_INNER_L2:
    case SYS_TMM_DISCARD_BSR_EPE_MIN_PKT_LEN_ERR:
    case SYS_TMM_DISCARD_BSR_EPE_ELOG_ABORTED_PKT:
    case SYS_TMM_DISCARD_BSR_EPE_TRUNCATE_PKT:
    case SYS_TMM_DISCARD_BSR_EPE_DATA_ERR:
        drop_reason = CTC_DROP_OTHER;
        break;
    default:
        break;
    }
    *p_drop_reason = drop_reason;
    return 0;
}
/*DISCARD_TO_DROP_END*/

/*GET_DISCARD_DESC_START*/
const char*
sys_tmm_get_discard_type_desc(uint16 discard_type)
{
    static char discard_desc[CTC_DIAG_REASON_DESC_LEN] = {0};
    switch (discard_type)
    {
    case SYS_TMM_DISCARD_IPE_RESERVED0:
        return "IPE_DISCARD_RESERVED0";
    case SYS_TMM_DISCARD_IPE_LPBK_HDR_ADJ_RM_ERR:
        return "IPE_DISCARD_LPBK_HDR_ADJ_RM_ERR";
    case SYS_TMM_DISCARD_IPE_PARSER_LEN_ERR:
        return "IPE_DISCARD_PARSER_LEN_ERR";
    case SYS_TMM_DISCARD_IPE_UC_TO_LAG_GROUP_NO_MEMBER:
        return "IPE_DISCARD_UC_TO_LAG_GROUP_NO_MEMBER";
    case SYS_TMM_DISCARD_IPE_EXCEP2_DIS:
        return "IPE_DISCARD_EXCEP2_DIS";
    case SYS_TMM_DISCARD_IPE_DS_USERID_DIS:
        return "IPE_DISCARD_DS_USERID_DIS";
    case SYS_TMM_DISCARD_IPE_RECEIVE_DIS:
        return "IPE_DISCARD_RECEIVE_DIS";
    case SYS_TMM_DISCARD_IPE_SVC_POLICING_DIS:
        return "IPE_DISCARD_SVC_POLICING_DIS";
    case SYS_TMM_DISCARD_IPE_PROTOCOL_VLAN_DIS:
        return "IPE_DISCARD_PROTOCOL_VLAN_DIS";
    case SYS_TMM_DISCARD_IPE_AFT_DIS:
        return "IPE_DISCARD_AFT_DIS";
    case SYS_TMM_DISCARD_IPE_L2_ILLEGAL_PKT_DIS:
        return "IPE_DISCARD_L2_ILLEGAL_PKT_DIS";
    case SYS_TMM_DISCARD_IPE_STP_DIS:
        return "IPE_DISCARD_STP_DIS";
    case SYS_TMM_DISCARD_IPE_DEST_MAP_PROFILE_DISCARD:
        return "IPE_DISCARD_DEST_MAP_PROFILE_DISCARD";
    case SYS_TMM_DISCARD_IPE_STACK_REFLECT_DISCARD:
        return "IPE_DISCARD_STACK_REFLECT_DISCARD";
    case SYS_TMM_DISCARD_IPE_ARP_DHCP_DIS:
        return "IPE_DISCARD_ARP_DHCP_DIS";
    case SYS_TMM_DISCARD_IPE_DS_PHYPORT_SRCDIS:
        return "IPE_DISCARD_DS_PHYPORT_SRCDIS";
    case SYS_TMM_DISCARD_IPE_VLAN_FILTER_DIS:
        return "IPE_DISCARD_VLAN_FILTER_DIS";
    case SYS_TMM_DISCARD_IPE_DS_SCL_DIS:
        return "IPE_DISCARD_DS_SCL_DIS";
    case SYS_TMM_DISCARD_IPE_ROUTE_ERROR_PKT_DIS:
        return "IPE_DISCARD_ROUTE_ERROR_PKT_DIS";
    case SYS_TMM_DISCARD_IPE_SECURITY_CHK_DIS:
        return "IPE_DISCARD_SECURITY_CHK_DIS";
    case SYS_TMM_DISCARD_IPE_STORM_CTL_DIS:
        return "IPE_DISCARD_STORM_CTL_DIS";
    case SYS_TMM_DISCARD_IPE_LEARNING_DIS:
        return "IPE_DISCARD_LEARNING_DIS";
    case SYS_TMM_DISCARD_IPE_NO_FORWARDING_PTR:
        return "IPE_DISCARD_NO_FORWARDING_PTR";
    case SYS_TMM_DISCARD_IPE_IS_DIS_FORWARDING_PTR:
        return "IPE_DISCARD_IS_DIS_FORWARDING_PTR";
    case SYS_TMM_DISCARD_IPE_FATAL_EXCEP_DIS:
        return "IPE_DISCARD_FATAL_EXCEP_DIS";
    case SYS_TMM_DISCARD_IPE_APS_DIS:
        return "IPE_DISCARD_APS_DIS";
    case SYS_TMM_DISCARD_IPE_DS_FWD_DESTID_DIS:
        return "IPE_DISCARD_DS_FWD_DESTID_DIS";
    case SYS_TMM_DISCARD_IPE_LOOPBACK_DIS:
        return "IPE_DISCARD_LOOPBACK_DIS";
    case SYS_TMM_DISCARD_IPE_DISCARD_PACKET_LOG_ALL_TYPE:
        return "IPE_DISCARD_DISCARD_PACKET_LOG_ALL_TYPE";
    case SYS_TMM_DISCARD_IPE_PORT_MAC_CHECK_DIS:
        return "IPE_DISCARD_PORT_MAC_CHECK_DIS";
    case SYS_TMM_DISCARD_IPE_L3_EXCEP_DIS:
        return "IPE_DISCARD_L3_EXCEP_DIS";
    case SYS_TMM_DISCARD_IPE_STACKING_HDR_CHK_ERR:
        return "IPE_DISCARD_STACKING_HDR_CHK_ERR";
    case SYS_TMM_DISCARD_IPE_TUNNEL_DECAP_MARTIAN_ADD:
        return "IPE_DISCARD_TUNNEL_DECAP_MARTIAN_ADD";
    case SYS_TMM_DISCARD_IPE_TUNNELID_FWD_PTR_DIS:
        return "IPE_DISCARD_TUNNELID_FWD_PTR_DIS";
    case SYS_TMM_DISCARD_IPE_VXLAN_FLAG_CHK_ERROR_DISCARD:
        return "IPE_DISCARD_VXLAN_FLAG_CHK_ERROR_DISCARD";
    case SYS_TMM_DISCARD_IPE_VXLAN_NVGRE_INNER_VTAG_CHK_DIS:
        return "IPE_DISCARD_VXLAN_NVGRE_INNER_VTAG_CHK_DIS";
    case SYS_TMM_DISCARD_IPE_VXLAN_NVGRE_CHK_FAIL:
        return "IPE_DISCARD_VXLAN_NVGRE_CHK_FAIL";
    case SYS_TMM_DISCARD_IPE_GENEVE_PAKCET_DISCARD:
        return "IPE_DISCARD_GENEVE_PAKCET_DISCARD";
    case SYS_TMM_DISCARD_IPE_ICMP_REDIRECT_DIS:
        return "IPE_DISCARD_ICMP_REDIRECT_DIS";
    case SYS_TMM_DISCARD_IPE_ICMP_ERR_MSG_DIS:
        return "IPE_DISCARD_ICMP_ERR_MSG_DIS";
    case SYS_TMM_DISCARD_IPE_PTP_PKT_DIS:
        return "IPE_DISCARD_PTP_PKT_DIS";
    case SYS_TMM_DISCARD_IPE_MUX_PORT_ERR:
        return "IPE_DISCARD_MUX_PORT_ERR";
    case SYS_TMM_DISCARD_IPE_HW_ERROR_DISCARD:
        return "IPE_DISCARD_HW_ERROR_DISCARD";
    case SYS_TMM_DISCARD_IPE_USERID_BINDING_DIS:
        return "IPE_DISCARD_USERID_BINDING_DIS";
    case SYS_TMM_DISCARD_IPE_MACSEC_UNCONTROLLED_PORT_DIS:
        return "IPE_DISCARD_MACSEC_UNCONTROLLED_PORT_DIS";
    case SYS_TMM_DISCARD_IPE_DS_PLC_DIS:
        return "IPE_DISCARD_DS_PLC_DIS";
    case SYS_TMM_DISCARD_IPE_DS_ACL_DIS:
        return "IPE_DISCARD_DS_ACL_DIS";
    case SYS_TMM_DISCARD_IPE_OAM_DISABLE:
        return "IPE_DISCARD_OAM_DISABLE";
    case SYS_TMM_DISCARD_IPE_OAM_NOT_FOUND:
        return "IPE_DISCARD_OAM_NOT_FOUND";
    case SYS_TMM_DISCARD_IPE_CFLAX_SRC_ISOLATE_DIS:
        return "IPE_DISCARD_CFLAX_SRC_ISOLATE_DIS";
    case SYS_TMM_DISCARD_IPE_OAM_ETH_VLAN_CHK:
        return "IPE_DISCARD_OAM_ETH_VLAN_CHK";
    case SYS_TMM_DISCARD_IPE_OAM_BFD_TTL_CHK:
        return "IPE_DISCARD_OAM_BFD_TTL_CHK";
    case SYS_TMM_DISCARD_IPE_OAM_FILTER_DIS:
        return "IPE_DISCARD_OAM_FILTER_DIS";
    case SYS_TMM_DISCARD_IPE_TRILL_CHK:
        return "IPE_DISCARD_TRILL_CHK";
    case SYS_TMM_DISCARD_IPE_INT_CHK:
        return "IPE_DISCARD_INT_CHK";
    case SYS_TMM_DISCARD_IPE_TUNNEL_ECN_DIS:
        return "IPE_DISCARD_TUNNEL_ECN_DIS";
    case SYS_TMM_DISCARD_IPE_EFM_DIS:
        return "IPE_DISCARD_EFM_DIS";
    case SYS_TMM_DISCARD_IPE_USERID_CHK:
        return "IPE_DISCARD_USERID_CHK";
    case SYS_TMM_DISCARD_IPE_MPLS_ENTROPY_LABEL_CHK:
        return "IPE_DISCARD_MPLS_ENTROPY_LABEL_CHK";
    case SYS_TMM_DISCARD_IPE_MPLS_TP_MCC_SCC_DIS:
        return "IPE_DISCARD_MPLS_TP_MCC_SCC_DIS";
    case SYS_TMM_DISCARD_IPE_MPLS_MC_PKT_ERROR:
        return "IPE_DISCARD_MPLS_MC_PKT_ERROR";
    case SYS_TMM_DISCARD_IPE_L2_EXCPTION_DIS:
        return "IPE_DISCARD_L2_EXCPTION_DIS";
    case SYS_TMM_DISCARD_IPE_MIMICRY_DIS:
        return "IPE_DISCARD_MIMICRY_DIS";
    case SYS_TMM_DISCARD_IPE_SD_CHECK_DIS:
        return "IPE_DISCARD_SD_CHECK_DIS";
    case SYS_TMM_DISCARD_EPE_RESERVED:
        return "EPE_DISCARD_RESERVED";
    case SYS_TMM_DISCARD_EPE_HDR_ADJ_DESTID_DIS:
        return "EPE_DISCARD_HDR_ADJ_DESTID_DIS";
    case SYS_TMM_DISCARD_EPE_HDR_ADJ_REMOVE_ERR:
        return "EPE_DISCARD_HDR_ADJ_REMOVE_ERR";
    case SYS_TMM_DISCARD_EPE_DS_DESTPHYPORT_DSTID_DIS:
        return "EPE_DISCARD_DS_DESTPHYPORT_DSTID_DIS";
    case SYS_TMM_DISCARD_EPE_PORT_ISO_DIS:
        return "EPE_DISCARD_PORT_ISO_DIS";
    case SYS_TMM_DISCARD_EPE_DS_VLAN_TRANSMIT_DIS:
        return "EPE_DISCARD_DS_VLAN_TRANSMIT_DIS";
    case SYS_TMM_DISCARD_EPE_BRG_TO_SAME_PORT_DIS:
        return "EPE_DISCARD_BRG_TO_SAME_PORT_DIS";
    case SYS_TMM_DISCARD_EPE_VPLS_HORIZON_SPLIT_DIS:
        return "EPE_DISCARD_VPLS_HORIZON_SPLIT_DIS";
    case SYS_TMM_DISCARD_EPE_VLAN_FILTER_DIS:
        return "EPE_DISCARD_VLAN_FILTER_DIS";
    case SYS_TMM_DISCARD_EPE_STP_DIS:
        return "EPE_DISCARD_STP_DIS";
    case SYS_TMM_DISCARD_EPE_PARSER_LEN_ERR:
        return "EPE_DISCARD_PARSER_LEN_ERR";
    case SYS_TMM_DISCARD_EPE_RESERVED0:
        return "EPE_DISCARD_RESERVED0";
    case SYS_TMM_DISCARD_EPE_UC_MC_FLOODING_DIS:
        return "EPE_DISCARD_UC_MC_FLOODING_DIS";
    case SYS_TMM_DISCARD_EPE_OAM_802_3_DIS:
        return "EPE_DISCARD_OAM_802_3_DIS";
    case SYS_TMM_DISCARD_EPE_TTL_FAIL:
        return "EPE_DISCARD_TTL_FAIL";
    case SYS_TMM_DISCARD_EPE_REMOTE_MIRROR_ESCAP_DIS:
        return "EPE_DISCARD_REMOTE_MIRROR_ESCAP_DIS";
    case SYS_TMM_DISCARD_EPE_TUNNEL_MTU_CHK_DIS:
        return "EPE_DISCARD_TUNNEL_MTU_CHK_DIS";
    case SYS_TMM_DISCARD_EPE_INTERF_MTU_CHK_DIS:
        return "EPE_DISCARD_INTERF_MTU_CHK_DIS";
    case SYS_TMM_DISCARD_EPE_LOGIC_PORT_CHK_DIS:
        return "EPE_DISCARD_LOGIC_PORT_CHK_DIS";
    case SYS_TMM_DISCARD_EPE_DS_ACL_DIS:
        return "EPE_DISCARD_DS_ACL_DIS";
    case SYS_TMM_DISCARD_EPE_DS_VLAN_XLATE_DIS:
        return "EPE_DISCARD_DS_VLAN_XLATE_DIS";
    case SYS_TMM_DISCARD_EPE_DS_PLC_DIS:
        return "EPE_DISCARD_DS_PLC_DIS";
    case SYS_TMM_DISCARD_EPE_CRC_ERR_DIS:
        return "EPE_DISCARD_CRC_ERR_DIS";
    case SYS_TMM_DISCARD_EPE_ROUTE_PLD_OP_DIS:
        return "EPE_DISCARD_ROUTE_PLD_OP_DIS";
    case SYS_TMM_DISCARD_EPE_BRIDGE_PLD_OP_DIS:
        return "EPE_DISCARD_BRIDGE_PLD_OP_DIS";
    case SYS_TMM_DISCARD_EPE_STRIP_OFFSET_LARGE:
        return "EPE_DISCARD_STRIP_OFFSET_LARGE";
    case SYS_TMM_DISCARD_EPE_BFD_DIS:
        return "EPE_DISCARD_BFD_DIS";
    case SYS_TMM_DISCARD_EPE_PORT_REFLECTIVE_CHK_DIS:
        return "EPE_DISCARD_PORT_REFLECTIVE_CHK_DIS";
    case SYS_TMM_DISCARD_EPE_IP_MPLS_TTL_CHK_ERR:
        return "EPE_DISCARD_IP_MPLS_TTL_CHK_ERR";
    case SYS_TMM_DISCARD_EPE_OAM_EDGE_PORT_DIS:
        return "EPE_DISCARD_OAM_EDGE_PORT_DIS";
    case SYS_TMM_DISCARD_EPE_NAT_PT_ICMP_ERR:
        return "EPE_DISCARD_NAT_PT_ICMP_ERR";
    case SYS_TMM_DISCARD_EPE_LATENCY_DISCARD:
        return "EPE_DISCARD_LATENCY_DISCARD";
    case SYS_TMM_DISCARD_EPE_LOCAL_OAM_DIS:
        return "EPE_DISCARD_LOCAL_OAM_DIS";
    case SYS_TMM_DISCARD_EPE_OAM_FILTERING_DIS:
        return "EPE_DISCARD_OAM_FILTERING_DIS";
    case SYS_TMM_DISCARD_EPE_RESERVED5:
        return "EPE_DISCARD_RESERVED5";
    case SYS_TMM_DISCARD_EPE_SAME_IPDA_IPSA_DIS:
        return "EPE_DISCARD_SAME_IPDA_IPSA_DIS";
    case SYS_TMM_DISCARD_EPE_SD_CHK_DISCARD:
        return "EPE_DISCARD_SD_CHK_DISCARD";
    case SYS_TMM_DISCARD_EPE_TRILL_PLD_OP_DIS:
        return "EPE_DISCARD_TRILL_PLD_OP_DIS";
    case SYS_TMM_DISCARD_EPE_RESERVED2:
        return "EPE_DISCARD_RESERVED2";
    case SYS_TMM_DISCARD_EPE_RESERVED4:
        return "EPE_DISCARD_RESERVED4";
    case SYS_TMM_DISCARD_EPE_DEST_VLAN_PTR_DIS:
        return "EPE_DISCARD_DEST_VLAN_PTR_DIS";
    case SYS_TMM_DISCARD_EPE_DS_L3EDIT_DATA_VIOLATE1:
        return "EPE_DISCARD_DS_L3EDIT_DATA_VIOLATE1";
    case SYS_TMM_DISCARD_EPE_DS_L3EDIT_DATA_VIOLATE2:
        return "EPE_DISCARD_DS_L3EDIT_DATA_VIOLATE2";
    case SYS_TMM_DISCARD_EPE_DS_L3EDITNAT_DATA_VIOLATE:
        return "EPE_DISCARD_DS_L3EDITNAT_DATA_VIOLATE";
    case SYS_TMM_DISCARD_EPE_DS_L2EDIT_DATA_VIOLATE1:
        return "EPE_DISCARD_DS_L2EDIT_DATA_VIOLATE1";
    case SYS_TMM_DISCARD_EPE_DS_L2EDIT_DATA_VIOLATE2:
        return "EPE_DISCARD_DS_L2EDIT_DATA_VIOLATE2";
    case SYS_TMM_DISCARD_EPE_PKT_HDR_C2C_TTL_ZERO:
        return "EPE_DISCARD_PKT_HDR_C2C_TTL_ZERO";
    case SYS_TMM_DISCARD_EPE_PT_UDP_CHKSUM_ZERO:
        return "EPE_DISCARD_PT_UDP_CHKSUM_ZERO";
    case SYS_TMM_DISCARD_EPE_OAM_TO_LOCAL_DIS:
        return "EPE_DISCARD_OAM_TO_LOCAL_DIS";
    case SYS_TMM_DISCARD_EPE_HARD_ERROR_DIS:
        return "EPE_DISCARD_HARD_ERROR_DIS";
    case SYS_TMM_DISCARD_EPE_RESERVED3:
        return "EPE_DISCARD_RESERVED3";
    case SYS_TMM_DISCARD_EPE_ARP_MISS_DISCARD:
        return "EPE_DISCARD_ARP_MISS_DISCARD";
    case SYS_TMM_DISCARD_EPE_ILLEGAL_PACKET_TO_E2I_LOOP_CHANNEL:
        return "EPE_DISCARD_ILLEGAL_PACKET_TO_E2I_LOOP_CHANNEL";
    case SYS_TMM_DISCARD_EPE_UNKNOWN_DOT11_PACKET_DISCARD:
        return "EPE_DISCARD_UNKNOWN_DOT11_PACKET_DISCARD";
    case SYS_TMM_DISCARD_EPE_DOT1AE_PN_OVERFLOW:
        return "EPE_DISCARD_DOT1AE_PN_OVERFLOW";
    case SYS_TMM_DISCARD_EPE_PON_DOWNSTREAM_CHECK_FAIL:
        return "EPE_DISCARD_PON_DOWNSTREAM_CHECK_FAIL";
    case SYS_TMM_DISCARD_EPE_DS_PORT_TRANSMIT_DIS:
        return "EPE_DISCARD_DS_PORT_TRANSMIT_DIS";
    case SYS_TMM_DISCARD_EPE_INT_SINK_DIS:
        return "EPE_DISCARD_INT_SINK_DIS";
    case SYS_TMM_DISCARD_EPE_EVPN_HORIZON_SPLIT_DIS:
        return "EPE_DISCARD_EVPN_HORIZON_SPLIT_DIS";
    case SYS_TMM_DISCARD_EPE_SPAN_ONDROP_RSV_QUID:
        return "EPE_DISCARD_SPAN_ONDROP_RSV_QUID";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_ABORT_TOTAL:
        return "BSR_DISCARD_BUFSTORE_ABORT_TOTAL";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_LEN_ERROR:
        return "BSR_DISCARD_BUFSTORE_LEN_ERROR";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_IRM_RESRC:
        return "BSR_DISCARD_BUFSTORE_IRM_RESRC";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_DATA_ERR:
        return "BSR_DISCARD_BUFSTORE_DATA_ERR";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_CHIP_MISMATCH:
        return "BSR_DISCARD_BUFSTORE_CHIP_MISMATCH";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_NO_BUFF:
        return "BSR_DISCARD_BUFSTORE_NO_BUFF";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_NO_EOP:
        return "BSR_DISCARD_BUFSTORE_NO_EOP";
    case SYS_TMM_DISCARD_BSR_METFIFO_STALL_TO_BS_DROP:
        return "BSR_DISCARD_METFIFO_STALL_TO_BS_DROP";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_SLIENT_TOTAL:
        return "BSR_DISCARD_BUFSTORE_SLIENT_TOTAL";
    case SYS_TMM_DISCARD_BSR_TO_BUFSTORE_FROM_DMA:
        return "BSR_DISCARD_TO_BUFSTORE_FROM_DMA";
    case SYS_TMM_DISCARD_BSR_TO_BUFSTORE_FROM_NETRX:
        return "BSR_DISCARD_TO_BUFSTORE_FROM_NETRX";
    case SYS_TMM_DISCARD_BSR_TO_BUFSTORE_FROM_OAM:
        return "BSR_DISCARD_TO_BUFSTORE_FROM_OAM";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_OUT_SOP_PKT_LEN_ERR:
        return "BSR_DISCARD_BUFSTORE_OUT_SOP_PKT_LEN_ERR";
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_DMA:
        return "BSR_DISCARD_METFIFO_MC_FROM_DMA";
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_DMA:
        return "BSR_DISCARD_METFIFO_UC_FROM_DMA";
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_ELOOP_MCAST:
        return "BSR_DISCARD_METFIFO_MC_FROM_ELOOP_MCAST";
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_ELOOP_UCAST:
        return "BSR_DISCARD_METFIFO_UC_FROM_ELOOP_UCAST";
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_IPE_CUT_THR:
        return "BSR_DISCARD_METFIFO_MC_FROM_IPE_CUT_THR";
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_IPE_CUT_THR:
        return "BSR_DISCARD_METFIFO_UC_FROM_IPE_CUT_THR";
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_IPE:
        return "BSR_DISCARD_METFIFO_MC_FROM_IPE";
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_IPE:
        return "BSR_DISCARD_METFIFO_UC_FROM_IPE";
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_OAM:
        return "BSR_DISCARD_METFIFO_MC_FROM_OAM";
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_OAM:
        return "BSR_DISCARD_METFIFO_UC_FROM_OAM";
    case SYS_TMM_DISCARD_BSR_BUFRETRV_FROM_DEQ_MSG_ERR:
        return "BSR_DISCARD_BUFRETRV_FROM_DEQ_MSG_ERR";
    case SYS_TMM_DISCARD_BSR_BUFRETRV_FROM_QMGR_LEN_ERR:
        return "BSR_DISCARD_BUFRETRV_FROM_QMGR_LEN_ERR";
    case SYS_TMM_DISCARD_BSR_BUFRETRV_OUT_DROP:
        return "BSR_DISCARD_BUFRETRV_OUT_DROP";
    case SYS_TMM_DISCARD_BSR_ENQ_WRED_DROP:
        return "BSR_DISCARD_ENQ_WRED_DROP";
    case SYS_TMM_DISCARD_BSR_ENQ_TOTAL_DROP:
        return "BSR_DISCARD_ENQ_TOTAL_DROP";
    case SYS_TMM_DISCARD_BSR_ENQ_NO_QUEUE_ENTRY:
        return "BSR_DISCARD_ENQ_NO_QUEUE_ENTRY";
    case SYS_TMM_DISCARD_BSR_ENQ_PORT_NO_BUFF:
        return "BSR_DISCARD_ENQ_PORT_NO_BUFF";
    case SYS_TMM_DISCARD_BSR_ENQ_QUEUE_NO_BUFF:
        return "BSR_DISCARD_ENQ_QUEUE_NO_BUFF";
    case SYS_TMM_DISCARD_BSR_ENQ_SC_NO_BUFF:
        return "BSR_DISCARD_ENQ_SC_NO_BUFF";
    case SYS_TMM_DISCARD_BSR_ENQ_SPAN_NO_BUFF:
        return "BSR_DISCARD_ENQ_SPAN_NO_BUFF";
    case SYS_TMM_DISCARD_BSR_ENQ_TOTAL_NO_BUFF:
        return "BSR_DISCARD_ENQ_TOTAL_NO_BUFF";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP:
        return "BSR_DISCARD_ENQ_FWD_DROP";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_CFLEX_ISOLATE_BLOCK:
        return "BSR_DISCARD_ENQ_FWD_DROP_CFLEX_ISOLATE_BLOCK";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_CHAN_INVALID:
        return "BSR_DISCARD_ENQ_FWD_DROP_CHAN_INVALID";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_TOTAL:
        return "BSR_DISCARD_ENQ_FWD_DROP_TOTAL";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_LAG:
        return "BSR_DISCARD_ENQ_FWD_DROP_FROM_LAG";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_LAG_ERR:
        return "BSR_DISCARD_ENQ_FWD_DROP_FROM_LAG_ERR";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_LAG_MC:
        return "BSR_DISCARD_ENQ_FWD_DROP_FROM_LAG_MC";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_LAG_NO_MEM:
        return "BSR_DISCARD_ENQ_FWD_DROP_FROM_LAG_NO_MEM";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_PORT_ISOLATE_BLOCK:
        return "BSR_DISCARD_ENQ_FWD_DROP_PORT_ISOLATE_BLOCK";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_RSV_CHAN_DROP:
        return "BSR_DISCARD_ENQ_FWD_DROP_RSV_CHAN_DROP";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_STACKING_LAG:
        return "BSR_DISCARD_ENQ_FWD_DROP_FROM_STACKING_LAG";
    case SYS_TMM_DISCARD_BSR_QWRITE_CFLEX_ISOLATE_BLOCK:
        return "BSR_QWRITE_CFLEX_ISOLATE_BLOCK";
    case SYS_TMM_DISCARD_BSR_QWRITE_PORT_ISOLATE_BLOCK:
        return "BSR_QWRITE_PORT_ISOLATE_BLOCK";
    case SYS_TMM_DISCARD_BSR_QWRITE_CHAN:
        return "BSR_QWRITE_CHAN";
    case SYS_TMM_DISCARD_BSR_QWRITE_FABRIC_TO_ILOOP:
        return "BSR_QWRITE_FABRIC_TO_ILOOP";
    case SYS_TMM_DISCARD_BSR_QWRITE_DROP_FROM_MET:
        return "BSR_QWRITE_DROP_FROM_MET";
    case SYS_TMM_DISCARD_BSR_OAM_HW_ERROR:
        return "BSR_DISCARD_OAM_HW_ERROR";
    case SYS_TMM_DISCARD_BSR_OAM_EXCEPTION:
        return "BSR_DISCARD_OAM_EXCEPTION";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_FIFO_FULL:
        return "BSR_DISCARD_BUFSTORE_FIFO_FULL";
    case SYS_TMM_DISCARD_NETTX_MIN_LEN:
        return "NETTX_DISCARD_MIN_LEN";
    case SYS_TMM_DISCARD_NETTX_NO_BUFFER:
        return "NETTX_DISCARD_NO_BUFFER";
    case SYS_TMM_DISCARD_NETTX_SOP_EOP:
        return "NETTX_DISCARD_SOP_EOP";
    case SYS_TMM_DISCARD_NETTX_SOP:
        return "NETTX_DISCARD_SOP";
    case SYS_TMM_DISCARD_NETTX_TX_ERROR:
        return "NETTX_DISCARD_TX_ERROR";
    case SYS_TMM_DISCARD_NETRX_NO_BUFFER:
        return "NETRX_DISCARD_NO_BUFFER";
    case SYS_TMM_DISCARD_NETRX_LEN_ERROR:
        return "NETRX_DISCARD_LEN_ERROR";
    case SYS_TMM_DISCARD_NETRX_PKT_ERROR:
        return "NETRX_DISCARD_PKT_ERROR";
    case SYS_TMM_DISCARD_NETRX_BPDU_ERROR:
        return "NETRX_DISCARD_BPDU_ERROR";
    case SYS_TMM_DISCARD_NETRX_FRAME_ERROR:
        return "NETRX_DISCARD_FRAME_ERROR";
    case SYS_TMM_DISCARD_NETRX_TXQM3_MIDPRIO_DROP:
        return "NETRX_DISCARD_TXQM3_MIDPRIO_DROP";
    case SYS_TMM_DISCARD_NETRX_TXQM2_MIDPRIO_DROP:
        return "NETRX_DISCARD_TXQM2_MIDPRIO_DROP";
    case SYS_TMM_DISCARD_NETRX_TXQM1_MIDPRIO_DROP:
        return "NETRX_DISCARD_TXQM1_MIDPRIO_DROP";
    case SYS_TMM_DISCARD_NETRX_TXQM0_MIDPRIO_DROP:
        return "NETRX_DISCARD_TXQM0_MIDPRIO_DROP";
    case SYS_TMM_DISCARD_NETRX_TXQM3_HIGHPRIO_DROP:
        return "NETRX_DISCARD_TXQM3_HIGHPRIO_DROP";
    case SYS_TMM_DISCARD_NETRX_TXQM2_HIGHPRIO_DROP:
        return "NETRX_DISCARD_TXQM2_HIGHPRIO_DROP";
    case SYS_TMM_DISCARD_NETRX_TXQM1_HIGHPRIO_DROP:
        return "NETRX_DISCARD_TXQM1_HIGHPRIO_DROP";
    case SYS_TMM_DISCARD_NETRX_TXQM0_HIGHPRIO_DROP:
        return "NETRX_DISCARD_TXQM0_HIGHPRIO_DROP";
    case SYS_TMM_DISCARD_NETRX_CPUMAC_CHECK_ERROR:
        return "NETRX_DISCARD_CPUMAC_CHECK_ERROR";
    case SYS_TMM_DISCARD_NETRX_MTULEN_CHECK:
        return "NETRX_DISCARD_MTULEN_CHECK";
    case SYS_TMM_DISCARD_NETRX_SOPBUF_FULL_DROP:
        return "NETRX_DISCARD_SOPBUF_FULL_DROP";
    case SYS_TMM_DISCARD_NETRX_VALIDBYTE_ERROR:
        return "NETRX_DISCARD_VALIDBYTE_ERROR";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_HW_ERR:
        return "BSR_DISCARD_HW_ERR";
    case SYS_TMM_DISCARD_NETRX_FROM_CPUMAC:
    return "NETRX_DISCARD_FROM_CPUMAC";
    case SYS_TMM_DISCARD_NETRX_FROM_DMA:
        return "NETRX_DISCARD_FROM_DMA";
    case SYS_TMM_DISCARD_NETRX_FROM_OAM:
        return "NETRX_DISCARD_FROM_OAM";
    case SYS_TMM_DISCARD_NETRX_FROM_LOOP:
        return "NETRX_DISCARD_FROM_LOOP";
    case SYS_TMM_DISCARD_NETRX_FROM_NETWORK:
        return "NETRX_DISCARD_FROM_NETWORK";
    case SYS_TMM_DISCARD_NETRX_OUT_ERROR:
        return "NETRX_DISCARD_OUT_ERROR";
    case SYS_TMM_DISCARD_NETRX_PFC_ERROR:
        return "NETRX_DISCARD_PFC_ERROR";
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_CPU:
        return "BSR_DISCARD_METFIFO_MC_FROM_CPU";
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_CPU:
        return "BSR_DISCARD_METFIFO_UC_FROM_CPU";
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_ELOG:
        return "BSR_DISCARD_METFIFO_MC_FROM_ELOG";
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_ELOG:
        return "BSR_DISCARD_METFIFO_UC_FROM_ELOG";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_DROP_DESTID:
        return "BSR_DISCARD_DROP_DESTID";
    case SYS_TMM_DISCARD_BSR_ENQ_PORT_SC_NO_BUFF:
        return "BSR_DISCARD_ENQ_PORT_SC_NO_BUFF";
    case SYS_TMM_DISCARD_BSR_ENQ_NO_RESRC:
        return "BSR_DISCARD_ENQ_NO_RESRC";
    case SYS_TMM_DISCARD_BSR_ERM_CHECK_FAIL:
        return "BSR_DISCARD_ERM_CHECK_FAIL";
    case SYS_TMM_DISCARD_BSR_ERM_CRIT_CHECK_FAIL:
        return "BSR_DISCARD_ERM_CRIT_CHECK_FAIL";
    case SYS_TMM_DISCARD_BSR_ERM_TOTAL_CHECK_FAIL:
        return "BSR_DISCARD_ERM_TOTAL_CHECK_FAIL";
    case SYS_TMM_DISCARD_BSR_ERM_SC_CHECK_FAIL:
        return "BSR_DISCARD_ERM_SC_CHECK_FAIL";
    case SYS_TMM_DISCARD_BSR_ERM_PORTSC_CHECK_FAIL:
        return "BSR_DISCARD_ERM_PORTSC_CHECK_FAIL";
    case SYS_TMM_DISCARD_BSR_ERM_PORT_CHECK_FAIL:
        return "BSR_DISCARD_ERM_PORT_CHECK_FAIL";
    case SYS_TMM_DISCARD_BSR_ERM_QUEUE_CHECK_FAIL:
        return "BSR_DISCARD_ERM_QUEUE_CHECK_FAIL";
    case SYS_TMM_DISCARD_BSR_ERM_AQMQUEUE_CHECK_FAIL:
        return "BSR_DISCARD_ERM_AQMQUEUE_CHECK_FAIL";
    case SYS_TMM_DISCARD_BSR_ERM_C2C_CHECK_FAIL:
        return "BSR_DISCARD_ERM_C2C_CHECK_FAIL";
    case SYS_TMM_DISCARD_BSR_ERM_NO_FREEPTR:
        return "BSR_DISCARD_ERM_NO_FREEPTR";
    case SYS_TMM_DISCARD_BSR_METFIFO_UCHI_COVER_LOG:
        return "BSR_METFIFO_UCHI_COVER_LOG";
    case SYS_TMM_DISCARD_BSR_METFIFO_UCLO_COVER_LOG:
        return "BSR_METFIFO_UCLO_COVER_LOG";
    case SYS_TMM_DISCARD_BSR_METFIFO_MCHI_COVER_LOG:
        return "BSR_METFIFO_MCHI_COVER_LOG";
    case SYS_TMM_DISCARD_BSR_METFIFO_MCLO_COVER_LOG:
        return "BSR_METFIFO_MCLO_COVER_LOG";
    case SYS_TMM_DISCARD_BSR_METFIFO_UCHI_IS_LOG:
        return "BSR_METFIFO_UCHI_IS_LOG";
    case SYS_TMM_DISCARD_BSR_METFIFO_UCLO_IS_LOG:
        return "BSR_METFIFO_UCLO_IS_LOG";
    case SYS_TMM_DISCARD_BSR_METFIFO_MCHI_IS_LOG:
        return "BSR_METFIFO_MCHI_IS_LOG";
    case SYS_TMM_DISCARD_BSR_METFIFO_MCLO_IS_LOG:
        return "BSR_METFIFO_MCLO_IS_LOG";
    case SYS_TMM_DISCARD_BSR_EPE_HW_L2_EDIT:
	    return "EPE_DISCARD_HW_L2_EDIT";
    case SYS_TMM_DISCARD_BSR_EPE_HW_L3_EDIT:
	    return "EPE_DISCARD_HW_L3_EDIT";
    case SYS_TMM_DISCARD_BSR_EPE_HW_INNER_L2:
	    return "EPE_DISCARD_HW_INNER_L2";
    case SYS_TMM_DISCARD_BSR_EPE_HW_PAYLOAD:
	    return "EPE_DISCARD_HW_PAYLOAD";
    case SYS_TMM_DISCARD_BSR_EPE_PAYLOAD:
	    return "EPE_DISCARD_PAYLOAD";
    case SYS_TMM_DISCARD_BSR_EPE_L2_EDIT:
	    return "EPE_DISCARD_L2_EDIT";
    case SYS_TMM_DISCARD_BSR_EPE_L3_EDIT:
	    return "EPE_DISCARD_L3_EDIT";
    case SYS_TMM_DISCARD_BSR_EPE_INNER_L2:
	    return "EPE_DISCARD_INNER_L2";
    case SYS_TMM_DISCARD_BSR_EPE_MIN_PKT_LEN_ERR:
	    return "EPE_DISCARD_MIN_PKT_LEN_ERR";
	case SYS_TMM_DISCARD_BSR_EPE_ELOG_ABORTED_PKT:
	    return "EPE_DISCARD_ELOG_ABORTED_PKT";
	case SYS_TMM_DISCARD_BSR_EPE_TRUNCATE_PKT:
	    return "EPE_DISCARD_TRUNCATE_PKT";
	case SYS_TMM_DISCARD_BSR_EPE_DATA_ERR:
	    return "EPE_DISCARD_DATA_ERR";
    default:
        sal_sprintf(discard_desc, "Reason id:%d", discard_type);
        return discard_desc;
    }
    return "";
}
/*GET_DISCARD_DESC_END*/
int32
sys_tmm_get_drop_resson_info(uint16 discard_type, uint8* p_dir, uint8* p_clear_on_read)
{
    if(discard_type <= SYS_TMM_DISCARD_IPE_END || 
        (discard_type >=SYS_TMM_DISCARD_NETRX_START && discard_type <=SYS_TMM_DISCARD_NETRX_END))
    {
        *p_dir = CTC_INGRESS;
    }
    else if(discard_type <= SYS_TMM_DISCARD_EPE_END ||
            (discard_type >=SYS_TMM_DISCARD_NETTX_START && discard_type <=SYS_TMM_DISCARD_NETTX_END))
    {
        *p_dir = CTC_EGRESS;
    }
    else
    {
        *p_dir = CTC_BOTH_DIRECTION; /*NOT care direction*/
    }

    *p_clear_on_read = (discard_type <= SYS_TMM_DISCARD_EPE_END) ? 1:0;
    return CTC_E_NONE;
}

int32
sys_tmm_map_discard_type(uint8 lchip, uint8 dir, uint8 drop_reason_en)
{
    uint16 sys_discard_type = 0;
    uint16 drop_reason = 0;
    uint32 cmd = 0;
    ds_t ds;
    uint8  drv_discard_type = 0;

    sal_memset(&ds, 0, sizeof(ds));
    if (dir == CTC_INGRESS || dir == CTC_BOTH_DIRECTION)
    {
        sys_discard_type = SYS_TMM_DISCARD_IPE_START;
        cmd = DRV_IOW(IpeAclDiscardMapCtl_t, DRV_ENTRY_FLAG);
        do
        {
            drv_discard_type = sys_discard_type - SYS_TMM_DISCARD_IPE_START;
            if (drop_reason_en != 0)
            {
                sys_tmm_map_drop_reason_sys_to_ctc(sys_discard_type, &drop_reason);
            }
            else
            {
                drop_reason = drv_discard_type;
            }
            SetIpeAclDiscardMapCtl(V, discardTypeMap_f, &ds, drop_reason);
            CTC_ERROR_RETURN( DRV_IOCTL(lchip, drv_discard_type, cmd, &ds) );
        }while(++sys_discard_type < SYS_TMM_DISCARD_IPE_END);
    }
    if (dir == CTC_EGRESS || dir == CTC_BOTH_DIRECTION)
    {
        sys_discard_type = SYS_TMM_DISCARD_EPE_START;
        cmd = DRV_IOW(EpeAclDiscardMapCtl_t, DRV_ENTRY_FLAG);
        do
        {
            drv_discard_type = sys_discard_type - SYS_TMM_DISCARD_EPE_START;
            if (drop_reason_en != 0)
            {
                sys_tmm_map_drop_reason_sys_to_ctc(sys_discard_type, &drop_reason);
            }
            else
            {
                drop_reason = drv_discard_type;
            }
            SetEpeAclDiscardMapCtl(V, discardTypeMap_f, &ds, drop_reason);
            CTC_ERROR_RETURN( DRV_IOCTL(lchip, drv_discard_type, cmd, &ds) );
        }while(++sys_discard_type < SYS_TMM_DISCARD_EPE_END);
    }

    return CTC_E_NONE;
}

/*GET_DISCARD_DESC_START*/
const char*
sys_tmm_get_discard_reason_desc(uint16 discard_type)
{
    static char discard_desc[128] = {0};
    switch (discard_type)
    {
    case SYS_TMM_DISCARD_IPE_RESERVED0:
        return "Ipe reserved0 discard";
    case SYS_TMM_DISCARD_IPE_LPBK_HDR_ADJ_RM_ERR:
        return "Packet discard due to length error when do loopback header adjust";
    case SYS_TMM_DISCARD_IPE_PARSER_LEN_ERR:
        return "Packet discard due to length error when do parser";
    case SYS_TMM_DISCARD_IPE_UC_TO_LAG_GROUP_NO_MEMBER:
        return "Packet discard due to ucast no linkagg member";
    case SYS_TMM_DISCARD_IPE_EXCEP2_DIS:
        return "L2 PDU discard  ";
    case SYS_TMM_DISCARD_IPE_DS_USERID_DIS:
        return "Next hop index from SCL is invalid";
    case SYS_TMM_DISCARD_IPE_RECEIVE_DIS:
        return "Port or vlan receive function is disabled";
    case SYS_TMM_DISCARD_IPE_SVC_POLICING_DIS:
        return "Microflow policing discard";
    case SYS_TMM_DISCARD_IPE_PROTOCOL_VLAN_DIS:
        return "Protocol vlan is configed as discard";
    case SYS_TMM_DISCARD_IPE_AFT_DIS:
        return "AFT discard";
    case SYS_TMM_DISCARD_IPE_L2_ILLEGAL_PKT_DIS:
        return "Packet discard due to invalid mcast MACSA or invalid IPDA/IPSA";
    case SYS_TMM_DISCARD_IPE_STP_DIS:
        return "STP discard";
    case SYS_TMM_DISCARD_IPE_DEST_MAP_PROFILE_DISCARD:
        return "Destmap of destmap profile is invalid(destmap=0xFFFF)";
    case SYS_TMM_DISCARD_IPE_STACK_REFLECT_DISCARD:
        return "Stack reflect discard";
    case SYS_TMM_DISCARD_IPE_ARP_DHCP_DIS:
        return "ARP or DHCP discard";
    case SYS_TMM_DISCARD_IPE_DS_PHYPORT_SRCDIS:
        return "Ingress phyport discard";
    case SYS_TMM_DISCARD_IPE_VLAN_FILTER_DIS:
        return "Ingress vlan filtering discard";
    case SYS_TMM_DISCARD_IPE_DS_SCL_DIS:
        return "Packet discard due to SCL deny or GRE flag mismatch";
    case SYS_TMM_DISCARD_IPE_ROUTE_ERROR_PKT_DIS:
        return "Mcast MAC DA discard or same IP DA SA discard";
    case SYS_TMM_DISCARD_IPE_SECURITY_CHK_DIS:
        return "Bridge dest port is equal to source port discard or unknown Mcast/Ucast or Bcast discard";
    case SYS_TMM_DISCARD_IPE_STORM_CTL_DIS:
        return "Port or vlan based storm Control discard";
    case SYS_TMM_DISCARD_IPE_LEARNING_DIS:
        return "MACSA is configed as discard or source port mismatch or port security discard";
    case SYS_TMM_DISCARD_IPE_NO_FORWARDING_PTR:
        return "Packet discard due to not find next hop(no dsFwdPtr)";
    case SYS_TMM_DISCARD_IPE_IS_DIS_FORWARDING_PTR:
        return "Packet discard due to next hop index is invalid(dsFwdPtr=0xFFFF)";
    case SYS_TMM_DISCARD_IPE_FATAL_EXCEP_DIS:
        return "Packet discard due to some fatal event occured";
    case SYS_TMM_DISCARD_IPE_APS_DIS:
        return "APS selector discard";
    case SYS_TMM_DISCARD_IPE_DS_FWD_DESTID_DIS:
        return "Packet discard due to next hop is invalid(nextHopPtr=0x3FFFF)";
    case SYS_TMM_DISCARD_IPE_LOOPBACK_DIS:
        return "Loopback discard when from Fabric is disabled";
    case SYS_TMM_DISCARD_IPE_DISCARD_PACKET_LOG_ALL_TYPE:
        return "Packet log all type discard";
    case SYS_TMM_DISCARD_IPE_PORT_MAC_CHECK_DIS:
        return "Port mac check discard";
    case SYS_TMM_DISCARD_IPE_L3_EXCEP_DIS:
        return "Packet discard due to VXLAN/NVGRE fraginfo error or ACH type error";
    case SYS_TMM_DISCARD_IPE_STACKING_HDR_CHK_ERR:
        return "Stacking network header length or MAC DA check error";
    case SYS_TMM_DISCARD_IPE_TUNNEL_DECAP_MARTIAN_ADD:
        return "IPv4/IPv6 tunnel outer IPSA is Martian address";
    case SYS_TMM_DISCARD_IPE_TUNNELID_FWD_PTR_DIS:
        return "Packet discard due to tunnel dsfwdptr is invalid(dsfwdptr=0xFFFF)";
    case SYS_TMM_DISCARD_IPE_VXLAN_FLAG_CHK_ERROR_DISCARD:
        return "VXLAN flag error";
    case SYS_TMM_DISCARD_IPE_VXLAN_NVGRE_INNER_VTAG_CHK_DIS:
        return "VXLAN/NVGRE inner Vtag check error";
    case SYS_TMM_DISCARD_IPE_VXLAN_NVGRE_CHK_FAIL:
        return "VXLAN/NVGRE check error";
    case SYS_TMM_DISCARD_IPE_GENEVE_PAKCET_DISCARD:
        return "VXLAN packet is OAM frame or has option or redirect to CPU";
    case SYS_TMM_DISCARD_IPE_ICMP_REDIRECT_DIS:
        return "ICMP discard or redirect to CPU";
    case SYS_TMM_DISCARD_IPE_ICMP_ERR_MSG_DIS:
        return "IPv4/IPv6 ICMP error MSG check discard";
    case SYS_TMM_DISCARD_IPE_PTP_PKT_DIS:
        return "PTP packet discard";
    case SYS_TMM_DISCARD_IPE_MUX_PORT_ERR:
        return "Mux port error";
    case SYS_TMM_DISCARD_IPE_HW_ERROR_DISCARD:
        return "Packet discard due to hardware error";
    case SYS_TMM_DISCARD_IPE_USERID_BINDING_DIS:
        return "Packet discard due to mac/port/vlan/ip/ binding mismatch";
    case SYS_TMM_DISCARD_IPE_MACSEC_UNCONTROLLED_PORT_DIS:
        return "Unidentified packet on port discard";
    case SYS_TMM_DISCARD_IPE_DS_PLC_DIS:
        return "Policing discard";
    case SYS_TMM_DISCARD_IPE_DS_ACL_DIS:
        return "ACL discard";
    case SYS_TMM_DISCARD_IPE_OAM_DISABLE:
        return "OAM discard";
    case SYS_TMM_DISCARD_IPE_OAM_NOT_FOUND:
        return "OAM lookup hash conflict or no MEP/MIP at ether OAM edge port";
    case SYS_TMM_DISCARD_IPE_CFLAX_SRC_ISOLATE_DIS:
        return "Cflex source isolate discard";
    case SYS_TMM_DISCARD_IPE_OAM_ETH_VLAN_CHK:
        return "Linkoam with vlan tag or ethoam without vlan tag";
    case SYS_TMM_DISCARD_IPE_OAM_BFD_TTL_CHK:
        return "BFD ttl check discard";
    case SYS_TMM_DISCARD_IPE_OAM_FILTER_DIS:
        return "OAM packet STP/VLAN filter when no MEP/MIP";
    case SYS_TMM_DISCARD_IPE_TRILL_CHK:
        return "Trill check discard";
    case SYS_TMM_DISCARD_IPE_INT_CHK:
        return "INT check discard";
    case SYS_TMM_DISCARD_IPE_TUNNEL_ECN_DIS:
        return "Tunnel ECN discard";
    case SYS_TMM_DISCARD_IPE_EFM_DIS:
        return "EFM OAM packet discard or redirect to CPU";
    case SYS_TMM_DISCARD_IPE_USERID_CHK:
        return "UserId check discard";
    case SYS_TMM_DISCARD_IPE_MPLS_ENTROPY_LABEL_CHK:
        return "Entropy label check discard";
    case SYS_TMM_DISCARD_IPE_MPLS_TP_MCC_SCC_DIS:
        return "TP MCC or SCC packet redirect to CPU";
    case SYS_TMM_DISCARD_IPE_MPLS_MC_PKT_ERROR:
        return "MPLS mcast discard";
    case SYS_TMM_DISCARD_IPE_L2_EXCPTION_DIS:
        return "L2 PDU discard";
    case SYS_TMM_DISCARD_IPE_MIMICRY_DIS:
        return "IPE_DISCARD_MIMICRY_DIS";
    case SYS_TMM_DISCARD_IPE_SD_CHECK_DIS:
        return "Signal degrade discard";
    case SYS_TMM_DISCARD_EPE_RESERVED:
        return "EPE reserved";
    case SYS_TMM_DISCARD_EPE_HDR_ADJ_DESTID_DIS:
        return "Packet discard by drop channel";
    case SYS_TMM_DISCARD_EPE_HDR_ADJ_REMOVE_ERR:
        return "Packet discard due to remove bytes error at header adjust(offset>144B)";
    case SYS_TMM_DISCARD_EPE_DS_DESTPHYPORT_DSTID_DIS:
        return "Egress port discard";
    case SYS_TMM_DISCARD_EPE_PORT_ISO_DIS:
        return "Port isolate or Pvlan discard";
    case SYS_TMM_DISCARD_EPE_DS_VLAN_TRANSMIT_DIS:
        return "Packet discard due to port/vlan transmit disable";
    case SYS_TMM_DISCARD_EPE_BRG_TO_SAME_PORT_DIS:
        return "Packet discard due to bridge to same port(no use)";
    case SYS_TMM_DISCARD_EPE_VPLS_HORIZON_SPLIT_DIS:
        return "VPLS split horizon split or E-tree discard";
    case SYS_TMM_DISCARD_EPE_VLAN_FILTER_DIS:
        return "Egress vlan filtering discard";
    case SYS_TMM_DISCARD_EPE_STP_DIS:
        return "STP discard";
    case SYS_TMM_DISCARD_EPE_PARSER_LEN_ERR:
        return "Packet discard due to parser length error";
    case SYS_TMM_DISCARD_EPE_RESERVED0:
        return "EPE reserved0";
    case SYS_TMM_DISCARD_EPE_UC_MC_FLOODING_DIS:
        return "Unkown-unicast/known-unicast/unkown-mcast/known-mcast/broadcast discard";
    case SYS_TMM_DISCARD_EPE_OAM_802_3_DIS:
        return "Discard non-EFM OAM packet";
    case SYS_TMM_DISCARD_EPE_TTL_FAIL:
        return "TTL check failed";
    case SYS_TMM_DISCARD_EPE_REMOTE_MIRROR_ESCAP_DIS:
        return "Packet discard due to remote mirror filtering";
    case SYS_TMM_DISCARD_EPE_TUNNEL_MTU_CHK_DIS:
        return "Packet discard due to tunnel MTU check";
    case SYS_TMM_DISCARD_EPE_INTERF_MTU_CHK_DIS:
        return "Packet discard due to interface MTU check";
    case SYS_TMM_DISCARD_EPE_LOGIC_PORT_CHK_DIS:
        return "Packet discard due to logic source port is equal to dest port";
    case SYS_TMM_DISCARD_EPE_DS_ACL_DIS:
        return "Packet discard due to ACL deny";
    case SYS_TMM_DISCARD_EPE_DS_VLAN_XLATE_DIS:
        return "Packet discard due to SCL deny";
    case SYS_TMM_DISCARD_EPE_CRC_ERR_DIS:
        return "Packet discard due to CRC check error(no use)";
    case SYS_TMM_DISCARD_EPE_ROUTE_PLD_OP_DIS:
        return "Packet discard due to route payload operation no IP";
    case SYS_TMM_DISCARD_EPE_BRIDGE_PLD_OP_DIS:
        return "Bridge payload operation bridge is disabled";
    case SYS_TMM_DISCARD_EPE_STRIP_OFFSET_LARGE:
        return "Packet strip offset is larger then efficientFirstBufferLength";
    case SYS_TMM_DISCARD_EPE_BFD_DIS:
        return "BFD discard(no use)";
    case SYS_TMM_DISCARD_EPE_PORT_REFLECTIVE_CHK_DIS:
        return "Packet discard due to dest port is equal to source port";
    case SYS_TMM_DISCARD_EPE_IP_MPLS_TTL_CHK_ERR:
        return "Packet discard due to IP/MPLS TTL check error when do L3 edit";
    case SYS_TMM_DISCARD_EPE_OAM_EDGE_PORT_DIS:
        return "No MEP/MIP at edge port for OAM packet";
    case SYS_TMM_DISCARD_EPE_NAT_PT_ICMP_ERR:
        return "NAT/PT ICMP error";
    case SYS_TMM_DISCARD_EPE_LATENCY_DISCARD:
        return "Packet discard due to latency is too long";
    case SYS_TMM_DISCARD_EPE_LOCAL_OAM_DIS:
        return "Local OAM discard(no use)";
    case SYS_TMM_DISCARD_EPE_OAM_FILTERING_DIS:
        return "OAM packet Port/STP/VLAN filter discard or forward link OAM packet";
    case SYS_TMM_DISCARD_EPE_RESERVED5:
        return "EPE reserved5";
    case SYS_TMM_DISCARD_EPE_SAME_IPDA_IPSA_DIS:
        return "Same MAC DA SA or IP DA SA ";
    case SYS_TMM_DISCARD_EPE_SD_CHK_DISCARD:
        return "Signal degrade discard";
    case SYS_TMM_DISCARD_EPE_TRILL_PLD_OP_DIS:
        return "TRILL payload operation discard(no use)";
    case SYS_TMM_DISCARD_EPE_RESERVED2:
        return "EPE reserved2";
    case SYS_TMM_DISCARD_EPE_RESERVED4:
        return "EPE reserved4";
    case SYS_TMM_DISCARD_EPE_DEST_VLAN_PTR_DIS:
        return "Packet discard due to dest vlan index is invalid";
    case SYS_TMM_DISCARD_EPE_DS_L3EDIT_DATA_VIOLATE1:
    case SYS_TMM_DISCARD_EPE_DS_L3EDIT_DATA_VIOLATE2:
    case SYS_TMM_DISCARD_EPE_DS_L3EDITNAT_DATA_VIOLATE:
        return "Discard by L3 edit or inner L2 edit violate";
    case SYS_TMM_DISCARD_EPE_DS_L2EDIT_DATA_VIOLATE1:
        return "Discard by L2 edit config";
    case SYS_TMM_DISCARD_EPE_DS_L2EDIT_DATA_VIOLATE2:
        return "Discard by L2 edit violate";
    case SYS_TMM_DISCARD_EPE_PKT_HDR_C2C_TTL_ZERO:
        return "Packet discard due to packetHeader C2C TTL zero(no use)";
    case SYS_TMM_DISCARD_EPE_PT_UDP_CHKSUM_ZERO:
        return "Packet discard due to PT/UDP checksum is zero for NAT";
    case SYS_TMM_DISCARD_EPE_OAM_TO_LOCAL_DIS:
        return "Packet is sent to local up MEP";
    case SYS_TMM_DISCARD_EPE_HARD_ERROR_DIS:
        return "Packet discard due to hardware error";
    case SYS_TMM_DISCARD_EPE_RESERVED3:
        return "EPE reserved3";
    case SYS_TMM_DISCARD_EPE_ARP_MISS_DISCARD:
        return "ARP miss discard";
    case SYS_TMM_DISCARD_EPE_ILLEGAL_PACKET_TO_E2I_LOOP_CHANNEL:
        return "Packet discard due to illegal packet to e2iloop channel";
    case SYS_TMM_DISCARD_EPE_UNKNOWN_DOT11_PACKET_DISCARD:
    case SYS_TMM_DISCARD_EPE_DOT1AE_PN_OVERFLOW:
        return "nknow dot1ae packet discard";
    case SYS_TMM_DISCARD_EPE_PON_DOWNSTREAM_CHECK_FAIL:
        return "Packet discard due to pon downstream check";
    case SYS_TMM_DISCARD_EPE_DS_PORT_TRANSMIT_DIS:
        return "Packet discard due to port transmit disable";
    case SYS_TMM_DISCARD_EPE_INT_SINK_DIS:
        return "Packet discard due to int sink";
    case SYS_TMM_DISCARD_EPE_EVPN_HORIZON_SPLIT_DIS:
        return "Packet discard due to evpn horizon split";
    case SYS_TMM_DISCARD_EPE_SPAN_ONDROP_RSV_QUID:
        return "Packet discard due to span on drop resv queue";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_ABORT_TOTAL:
        return "Packet discard in BSR and is due to crc/ecc/packet len error or miss EOP or pkt buffer is full";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_LEN_ERROR:
        return "Packet discard in BSR and is due to maximum or minimum packet length check";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_IRM_RESRC:
        return "Packet discard in BSR and is due to IRM no resource";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_DATA_ERR:
        return "Packet discard in BSR and is due to crc error or ecc error";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_HW_ERR:
        return "Packet discard due to hardware error";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_CHIP_MISMATCH:
        return "Packet discard in BSR and is due to chip id mismatch";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_NO_BUFF:
        return "Packet discard in BSR and is due to no pkt buffer";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_NO_EOP:
        return "Packet discard in BSR and is due to missing EOP";
    case SYS_TMM_DISCARD_BSR_METFIFO_STALL_TO_BS_DROP:
        return "Packet discard in BSR and is due to the copy ability of MET";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_SLIENT_TOTAL:
        return "Packet discard in BSR and is due to resource check fail";
    case SYS_TMM_DISCARD_BSR_TO_BUFSTORE_FROM_DMA:
        return "Packet from DMA discard in BSR and is due to Bufstore error";
    case SYS_TMM_DISCARD_BSR_TO_BUFSTORE_FROM_NETRX:
        return "Packet from NETRX discard in BSR and is due to Bufstore error";
    case SYS_TMM_DISCARD_BSR_TO_BUFSTORE_FROM_OAM:
        return "Packet from OAM discard in BSR and is due to Bufstore error";
    case SYS_TMM_DISCARD_BSR_BUFSTORE_OUT_SOP_PKT_LEN_ERR:
        return "Packet from BUFSTORE discard in BSR and is due to SOP length error";
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_DMA:
        return "Mcast packet from DMA discard in BSR and is due to the copy ability of MET";
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_DMA:
        return "Ucast packet from DMA discard in BSR and is due to the copy ability of MET";
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_ELOOP_MCAST:
        return "Eloop mcast packet discard in BSR and is due to the copy ability of MET";
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_ELOOP_UCAST:
        return "Eloop ucast packet discard in BSR and is due to the copy ability of MET";
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_IPE_CUT_THR:
        return "Mcast packet discard in BSR and is due to the copy ability of MET in cutthrough model";
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_IPE_CUT_THR:
        return "Ucast packet discard in BSR and is due to the copy ability of MET in cutthrough model";
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_IPE:
        return "IPE mcast packet discard in BSR and is due to the copy ability of MET";
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_IPE:
        return "IPE ucast packet discard in BSR and is due to the copy ability of MET";
    case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_OAM:
        return "OAM mcast packet discard in BSR and is due to the copy ability of MET";
    case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_OAM:
        return "OAM ucast packet discard in BSR and is due to the copy ability of MET";
    case SYS_TMM_DISCARD_BSR_BUFRETRV_FROM_DEQ_MSG_ERR:
        return "Packet from DEQ discard in BSR and is due to MSG error";
    case SYS_TMM_DISCARD_BSR_BUFRETRV_FROM_QMGR_LEN_ERR:
        return "Packet from QMGR discard in BSR and is due to length error";
    case SYS_TMM_DISCARD_BSR_BUFRETRV_OUT_DROP:
        return "Packet from bufRetrv discard in BSR";
    case SYS_TMM_DISCARD_BSR_ENQ_WRED_DROP:
        return "ENQ packet discard in BSR and is due to WRED error";
    case SYS_TMM_DISCARD_BSR_ENQ_TOTAL_DROP:
        return "ENQ packe total discard";
    case SYS_TMM_DISCARD_BSR_ENQ_NO_QUEUE_ENTRY:
        return "ENQ packet discard in BSR and is due to no ptr";
    case SYS_TMM_DISCARD_BSR_ENQ_PORT_NO_BUFF:
        return "ENQ packet discard in BSR and is due to port no buffer";
    case SYS_TMM_DISCARD_BSR_ENQ_QUEUE_NO_BUFF:
        return "ENQ packet discard in BSR and is due to queue no buffer";
    case SYS_TMM_DISCARD_BSR_ENQ_SC_NO_BUFF:
        return "ENQ packet discard in BSR and is due to service class no buffer";
    case SYS_TMM_DISCARD_BSR_ENQ_SPAN_NO_BUFF:
        return "ENQ packet discard in BSR and is due to span no buffer";
    case SYS_TMM_DISCARD_BSR_ENQ_TOTAL_NO_BUFF:
        return "ENQ packet discard in BSR and is due to no total buffer";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP:
        return "ENQ packet discard in BSR and is due to foward drop";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_CFLEX_ISOLATE_BLOCK:
        return "ENQ packet discard in BSR and is due to isolated port when stacking";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_CHAN_INVALID:
        return "ENQ packet discard in BSR and is due to invalid channel id";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_TOTAL:
        return "ENQ packet discard in BSR and is due to fowarding drop";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_LAG:
        return "ENQ packet discard in BSR and is due to linkagg error";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_LAG_ERR:
        return "ENQ packet discard in BSR and is due to crc error or memory error when do linkagg";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_LAG_MC:
        return "ENQ packet discard in BSR and is due to invalid dest chip id when do mcast linkagg";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_LAG_NO_MEM:
        return "ENQ packet discard in BSR and is due to no linkagg member";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_PORT_ISOLATE_BLOCK:
        return "ENQ packet discard in BSR and is due to isolated port";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_RSV_CHAN_DROP:
        return "ENQ packet discard in BSR and is due to drop channel";
    case SYS_TMM_DISCARD_BSR_ENQ_FWD_DROP_FROM_STACKING_LAG:
        return "ENQ packet discard in BSR and is due to stacking linkagg error";
    case SYS_TMM_DISCARD_BSR_QWRITE_CFLEX_ISOLATE_BLOCK:
        return "Packet drop due to cflex isolation";
    case SYS_TMM_DISCARD_BSR_QWRITE_PORT_ISOLATE_BLOCK:
        return "Packet drop due to port isolation";
    case SYS_TMM_DISCARD_BSR_QWRITE_CHAN:
        return "Dest channel invalid ";
    case SYS_TMM_DISCARD_BSR_QWRITE_FABRIC_TO_ILOOP:
        return "Fabric and LoopChannel and loop don't support oamPacket";
    case SYS_TMM_DISCARD_BSR_QWRITE_DROP_FROM_MET:
        return "Metfifo send dropped message";
    case SYS_TMM_DISCARD_BSR_OAM_HW_ERROR:
        return "Some hardware error occured";
    case SYS_TMM_DISCARD_BSR_OAM_EXCEPTION:
        return "Some exception occured when process OAM packet";
    case SYS_TMM_DISCARD_NETTX_MIN_LEN:
        return "Packet discard due to smaller than the cfgMinPktLen";
    case SYS_TMM_DISCARD_NETTX_NO_BUFFER:
        return "Packet discard due to the use up of PktBuffer in NETTX";
    case SYS_TMM_DISCARD_NETTX_SOP_EOP:
        return "Packet discard due to missing EOP or SOP";
    case SYS_TMM_DISCARD_NETTX_SOP:
        return "NETTX_DISCARD_SOP";
    case SYS_TMM_DISCARD_NETTX_TX_ERROR:
        return "The number of error packets sending to MAC";
    case SYS_TMM_DISCARD_NETRX_NO_BUFFER:
        return "Packet discard due to no buffer in port oversub model";
    case SYS_TMM_DISCARD_NETRX_LEN_ERROR:
        return "Packet discard due to the failure of max or min pkt len check";
    case SYS_TMM_DISCARD_NETRX_PKT_ERROR:
        return "Packet error discard";
    case SYS_TMM_DISCARD_NETRX_BPDU_ERROR:
        return "BPDU discard";
    case SYS_TMM_DISCARD_NETRX_FRAME_ERROR:
        return "acket discard due to misssing sop or eop";
    case SYS_TMM_DISCARD_NETRX_TXQM3_MIDPRIO_DROP:
    case SYS_TMM_DISCARD_NETRX_TXQM2_MIDPRIO_DROP:
    case SYS_TMM_DISCARD_NETRX_TXQM1_MIDPRIO_DROP:
    case SYS_TMM_DISCARD_NETRX_TXQM0_MIDPRIO_DROP:
    case SYS_TMM_DISCARD_NETRX_TXQM3_HIGHPRIO_DROP:
    case SYS_TMM_DISCARD_NETRX_TXQM2_HIGHPRIO_DROP:
    case SYS_TMM_DISCARD_NETRX_TXQM1_HIGHPRIO_DROP:
    case SYS_TMM_DISCARD_NETRX_TXQM0_HIGHPRIO_DROP:
        return "Priority packet drop due to NetRx buffer full";
    case SYS_TMM_DISCARD_NETRX_CPUMAC_CHECK_ERROR:
        return "Receive packet cfgCpuMacAddr error";
    case SYS_TMM_DISCARD_NETRX_MTULEN_CHECK:
        return "Receive ultra-short or ultra-long packet";
    case SYS_TMM_DISCARD_NETRX_SOPBUF_FULL_DROP:
        return "Buffer full during sop";
    case SYS_TMM_DISCARD_NETRX_VALIDBYTE_ERROR:
        return "Packet eop length error";
    case SYS_TMM_DISCARD_BSR_ENQ_PORT_SC_NO_BUFF:
	    return "ENQ packet discard in BSR and is due to port no buffer";
    case SYS_TMM_DISCARD_NETRX_FROM_DMA:
	    return "Received  from DMA pkt with error";
    case SYS_TMM_DISCARD_NETRX_FROM_OAM:
	    return "Received from OMA pkt with error";
    case SYS_TMM_DISCARD_NETRX_FROM_LOOP:
	    return "Separate statistics from the two loop interface pkts carrying error";
    case SYS_TMM_DISCARD_NETRX_FROM_NETWORK:
	    return "Four TXQMs count the number of 's with errors received from the mac";
    case SYS_TMM_DISCARD_NETRX_FROM_CPUMAC:
	    return "Received pkt from CpuMac with error";
    case SYS_TMM_DISCARD_NETRX_OUT_ERROR:
	    return "The pkt sent to BS carries the error";
    case SYS_TMM_DISCARD_NETRX_PFC_ERROR:
	    return "Pause packet don't send to BSR";
    case SYS_TMM_DISCARD_BSR_ENQ_NO_RESRC:
	    return "Marks whether the current queue has lost packets due to ERM check failure";
    case SYS_TMM_DISCARD_BSR_ERM_CHECK_FAIL:
        return "Multicast drop due to ERM check fail";
    case SYS_TMM_DISCARD_BSR_ERM_CRIT_CHECK_FAIL:
        return "Multicast critical packet drop due to ERM check fail";
    case SYS_TMM_DISCARD_BSR_ERM_TOTAL_CHECK_FAIL:
        return "Multicast total packet drop due to ERM check fail";
    case SYS_TMM_DISCARD_BSR_ERM_SC_CHECK_FAIL:
        return "Multicast sc packet drop due to ERM check fail";
    case SYS_TMM_DISCARD_BSR_ERM_PORTSC_CHECK_FAIL:
        return "Multicast port sc packet drop due to ERM check fail";
    case SYS_TMM_DISCARD_BSR_ERM_PORT_CHECK_FAIL:
        return "Multicast port packet drop due to ERM check fail";
    case SYS_TMM_DISCARD_BSR_ERM_QUEUE_CHECK_FAIL:
        return "Multicast queue packet drop due to ERM check fail";
    case SYS_TMM_DISCARD_BSR_ERM_AQMQUEUE_CHECK_FAIL:
        return "Multicast aqmqueue packet drop due to ERM check fail";
    case SYS_TMM_DISCARD_BSR_ERM_C2C_CHECK_FAIL:
        return "Multicast C2C packet drop due to ERM check fail";
    case SYS_TMM_DISCARD_BSR_ERM_NO_FREEPTR:
        return "Multicast packet drop no free addr";
    case SYS_TMM_DISCARD_BSR_METFIFO_UCHI_COVER_LOG:
        return "Ucast high packets cover log, ucast/mcast/excp flow full bandwidth drop log";
    case SYS_TMM_DISCARD_BSR_METFIFO_UCLO_COVER_LOG:
        return "Ucast low packets cover log, ucast/mcast/excp flow full bandwidth drop log";
    case SYS_TMM_DISCARD_BSR_METFIFO_MCHI_COVER_LOG:
        return "Mcast high packets cover log, ucast/mcast/excp flow full bandwidth drop log";
    case SYS_TMM_DISCARD_BSR_METFIFO_MCLO_COVER_LOG:
        return "Mcast low packets cover log, ucast/mcast/excp flow full bandwidth drop log";
    case SYS_TMM_DISCARD_BSR_METFIFO_UCHI_IS_LOG:
        return "Ucast high log packets, ucast/mcast/excp flow full bandwidth drop log";
    case SYS_TMM_DISCARD_BSR_METFIFO_UCLO_IS_LOG:
        return "Ucast low log packets, ucast/mcast/excp flow full bandwidth drop log";
    case SYS_TMM_DISCARD_BSR_METFIFO_MCHI_IS_LOG:
        return "Mcast high log packets, ucast/mcast/excp flow full bandwidth drop log";
    case SYS_TMM_DISCARD_BSR_METFIFO_MCLO_IS_LOG:
        return "Mcast low log packets, ucast/mcast/excp flow full bandwidth drop log";
    case SYS_TMM_DISCARD_BSR_EPE_HW_L2_EDIT:
	    return "Some hardware error occurred at l2 edit";
    case SYS_TMM_DISCARD_BSR_EPE_HW_L3_EDIT:
	    return "Some hardware error occurred at l3 edit";
    case SYS_TMM_DISCARD_BSR_EPE_HW_INNER_L2:
	    return "Some hardware error occurred at inner l2 edit";
    case SYS_TMM_DISCARD_BSR_EPE_HW_PAYLOAD:
	    return "Some hardware error occurred when edit payload";
    case SYS_TMM_DISCARD_BSR_EPE_PAYLOAD:
	    return "Some hardware error occurred when do OAM lookup";
    case SYS_TMM_DISCARD_BSR_EPE_L2_EDIT:
	    return "outer layer 2 piDiscard  received";
    case SYS_TMM_DISCARD_BSR_EPE_L3_EDIT:
	    return "outer layer 3 piDiscard  received";
    case SYS_TMM_DISCARD_BSR_EPE_INNER_L2:
	    return "inner layer2 execution logic received piDiscard";
    case SYS_TMM_DISCARD_BSR_EPE_MIN_PKT_LEN_ERR:
	    return "Packet discard due to min length check error";
	case SYS_TMM_DISCARD_BSR_EPE_ELOG_ABORTED_PKT:
	    return "Packet discard due to elog aborted";
	case SYS_TMM_DISCARD_BSR_EPE_TRUNCATE_PKT:
	    return "CpuMac/Dma/Oam dropped due to truncate";
	case SYS_TMM_DISCARD_BSR_EPE_DATA_ERR:
	    return "Data from BufRetrv, Epe carry error";
	case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_CPU:
	    return "CPU mcast packet discard in BSR and is due to the copy ability of MET";
	case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_CPU:
	    return "CPU ucast packet discard in BSR and is due to the copy ability of MET";
	case SYS_TMM_DISCARD_BSR_METFIFO_MC_FROM_ELOG:
	    return "ELOG mcast packet discard in BSR and is due to the copy ability of MET";
	case SYS_TMM_DISCARD_BSR_METFIFO_UC_FROM_ELOG:
	    return "ELOG ucast packet discard in BSR and is due to the copy ability of MET";
    default:
        sal_sprintf(discard_desc, "Reason id:%d", discard_type);
        return discard_desc;
    }
    return "";
}
/*GET_DISCARD_DESC_END*/

int32
sys_tmm_diag_get_drop_reason(uint8 lchip, uint32* reason)
{
    uint8 num = 0;
    uint32 dis_tmp = 0;
    for(dis_tmp = SYS_TMM_DISCARD_IPE_START; dis_tmp <= SYS_TMM_DISCARD_OAM_END; dis_tmp ++)
    {
        if (!CTC_BMP_ISSET(reason, dis_tmp))
        {
            continue;
        }
        num ++;
        SYS_DIAG_DBG_OUT(CTC_DEBUG_LEVEL_DUMP,"%d. %s, %s\n", num, sys_tmm_get_discard_type_desc(dis_tmp), sys_tmm_get_discard_reason_desc(dis_tmp));
    }
    return 0;
}
#endif

